split: switch to getline() for line/pattern matching Get rid of split's home-grown logic for growing the buffer; arbitrarily breaking at LONG_MAX bytes instead of 65536 bytes gives us much more wiggle room. Additionally, we'll actually fail out entirely if we can't fit a line, which makes noticing this class of problem much easier. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D36323
Details
Details
- Reviewers
bapt emaste pauamma_gundo.com - Group Reviewers
Klara manpages - Commits
- rG5c053aa3c5e9: split: switch to getline() for line/pattern matching
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 47984 Build 44871: arc lint + arc unit
Event Timeline
usr.bin/split/split.1 | ||
---|---|---|
215–219 | Make it more obvious that the restriction was removed. |
usr.bin/split/split.1 | ||
---|---|---|
219 | Did you mean to add something after "and"? |
usr.bin/split/split.1 | ||
---|---|---|
219 | whoops: "the -l flag's line counting" |
usr.bin/split/split.c | ||
---|---|---|
283–284 | why not use getline(3) here? |
usr.bin/split/split.1 | ||
---|---|---|
31 | Bump on commit. |
Comment Actions
Switch to getline() for split2's buffer management, move the global buf/bufsize
into split1() and keep that at MAXBSIZE.
Comment Actions
Clean up the diff a bit more; don't rename bfr -> buf for split1(), but maintain
the MAXBSIZE -> sizeof(bfr) change.