summaryrefslogtreecommitdiff
path: root/tests/pr/pr-tests.pl
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2023-04-25 14:07:03 +0100
committerPádraig Brady <P@draigBrady.com>2023-04-25 14:18:35 +0100
commit3fb0cc80fa5e1cede9ec05303a70c26d0d23ca1d (patch)
tree91f9f5268e56766ac7ed06489812746a96366c13 /tests/pr/pr-tests.pl
parentcc078f747f3db00e70b2ae2ad2ab34e8d54316d3 (diff)
downloadcoreutils-3fb0cc80fa5e1cede9ec05303a70c26d0d23ca1d.tar.gz
pr: fix infinite loop when double spacing
* src/pr.c (init_parameters): Ensure we avoid a 0 lines_per_body which was possible when adjusting for double spacing. That caused print_page() to always return true, causing an infinite loop. * tests/pr/pr-tests.pl: Add a test case. * NEWS: Mention the fix. Fixes https://bugs.debian.org/1034808
Diffstat (limited to 'tests/pr/pr-tests.pl')
-rwxr-xr-xtests/pr/pr-tests.pl3
1 files changed, 3 insertions, 0 deletions
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