From c8d3838681de7137a3eb1127c4c4486023bd2f00 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 26 Jul 2010 20:51:02 -0700 Subject: sort: fix bug with EOF at buffer refill * src/sort.c (fillbuf): Don't append eol unless the line is nonempty. This fixes a bug that was partly but not completely fixed by the aadc67dfdb47f28bb8d1fa5e0fe0f52e2a8c51bf commit (dated July 15). * tests/misc/sort (realloc-buf-2): New test, which catches this bug on 64-bit hosts. --- tests/misc/sort | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/misc') diff --git a/tests/misc/sort b/tests/misc/sort index 0b098452d..de189ddb9 100755 --- a/tests/misc/sort +++ b/tests/misc/sort @@ -367,6 +367,7 @@ my @Tests = # Exercise the code that enlarges the line buffer. See the thread here: # http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/11006 ['realloc-buf', '-S1', {IN=>'a'x4000 ."\n"}, {OUT=>'a'x4000 ."\n"}], +['realloc-buf-2', '-S1', {IN=>'a'x5 ."\n"}, {OUT=>'a'x5 ."\n"}], ["sort-numeric", '--sort=numeric', {IN=>".01\n0\n"}, {OUT=>"0\n.01\n"}], ["sort-gennum", '--sort=general-numeric', -- cgit v1.2.3-70-g09d2