From fec363cebf581ef27f6d01686dec5a0499aa6818 Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Sat, 20 Apr 2013 08:46:43 +0100 Subject: split: with --line-bytes only allocate memory as needed * src/split.c (line_bytes_split): Rewrite to only buffer when necessary. I.E. only increase the buffer when we've already lines output in a split and we encounter a line larger than the input buffer size, in which case a hold buffer will be increased in increments of the input buffer size. (lines_rr): Use the more abstract xalloc_die() just like we did in line_bytes_split(), rather than explicitly printing the "memory exhausted" message and exiting. * tests/split/line-bytes.sh: Add a new test for this function which previously had no test coverage. * tests/local.mk: Reference the new test. * NEWS: Mention the improvement. Fixes http://bugs.gnu.org/13537 --- tests/local.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/local.mk') diff --git a/tests/local.mk b/tests/local.mk index 5ec7d9859..58b7958c2 100644 --- a/tests/local.mk +++ b/tests/local.mk @@ -345,6 +345,7 @@ all_tests = \ tests/split/b-chunk.sh \ tests/split/fail.sh \ tests/split/lines.sh \ + tests/split/line-bytes.sh \ tests/split/l-chunk.sh \ tests/split/r-chunk.sh \ tests/split/numeric.sh \ -- cgit v1.2.3-70-g09d2