diff options
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | src/pr.c | 2 | ||||
-rwxr-xr-x | tests/pr/pr-tests.pl | 3 |
3 files changed, 7 insertions, 1 deletions
@@ -14,6 +14,9 @@ GNU coreutils NEWS -*- outline -*- factor, numfmt, and tsort now diagnose read errors on the input. [This bug was present in "the beginning".] + 'pr --length=1 --double-space' no longer enters an infinite loop. + [This bug was present in "the beginning".] + ** Changes in behavior 'cp -v' and 'mv -v' will no longer output a message for each file skipped @@ -1209,7 +1209,7 @@ init_parameters (int number_of_files) lines_per_body = lines_per_page; if (double_space) - lines_per_body = lines_per_body / 2; + lines_per_body = MAX (1, lines_per_body / 2); /* If input is stdin, cannot print parallel files. BSD dumps core on this. */ diff --git a/tests/pr/pr-tests.pl b/tests/pr/pr-tests.pl index 265e6e108..eafc13d81 100755 --- a/tests/pr/pr-tests.pl +++ b/tests/pr/pr-tests.pl @@ -415,6 +415,9 @@ my @tv = ( ['padding2', '-t -n,64', "1\n", (" "x 63)."1,1\n", 0], # Ensure we handle buffer truncation correctly ['padding3', '-t -N1000000 -n,1', "1\n", "0,1\n", 0], + +# This entered an infinite loop before coreutils-9.4 +['page-length1', '-dl1', "", "", 0], ); # Convert the above old-style test vectors to the newer |