]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
split: switch to getline() for line/pattern matching
authorKyle Evans <kevans@FreeBSD.org>
Tue, 23 Aug 2022 02:05:58 +0000 (21:05 -0500)
committerKyle Evans <kevans@FreeBSD.org>
Fri, 11 Nov 2022 18:08:46 +0000 (12:08 -0600)
commitf6a842313ca28d300beb36c0b765c10e0970b2ca
treef2d712c5bf90f45baed1dd1acaa75538426d9017
parent360741a63897c8538a8d55ebf37722d6eee67b8a
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.

Reviewed by: bapt, emaste, pauamma
Sponsored by: Klara, Inc.

(cherry picked from commit 5c053aa3c5e907bdd1ac466ce9b58611781c2c20)
usr.bin/split/split.1
usr.bin/split/split.c