diff options
author | Pádraig Brady <P@draigBrady.com> | 2011-08-24 00:09:30 +0100 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2011-08-24 00:21:17 +0100 |
commit | 1f93c9633997b8843e9b30ad29fe3b2631cf3655 (patch) | |
tree | 81326b6a5d93ab8b14e518abbc01c3a51d26ceb9 /src | |
parent | 423b079f5324b9097d487e752b71a8399b970ba9 (diff) | |
download | coreutils-1f93c9633997b8843e9b30ad29fe3b2631cf3655.tar.xz |
pr: fix so that LAST_PAGE is honored with -T
Ever since the LAST_PAGE functionality was added
in commit ed0923a1, 1996-12-05,
"Apply big patch (patch-20) from Roland Huebner"
it was ignored when -t or -T were specified or
when -l <= 10.
* src/pr.c (print_page): Increment the current page here.
(print_header): Don't increment the current page here.
* tests/pr/pr-tests: Add a test case.
* NEWS: Mention the fix
Reported at http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9347
Diffstat (limited to 'src')
-rw-r--r-- | src/pr.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1887,7 +1887,7 @@ print_page (void) print_a_FF = false; } - if (last_page_number < page_number) + if (last_page_number < ++page_number) return false; /* Stop printing with LAST_PAGE */ reset_status (); /* Change ON_HOLD to OPEN. */ @@ -2399,7 +2399,7 @@ print_header (void) /* The translator must ensure that formatting the translation of "Page %"PRIuMAX does not generate more than (sizeof page_text - 1) bytes. */ - sprintf (page_text, _("Page %"PRIuMAX), page_number++); + sprintf (page_text, _("Page %"PRIuMAX), page_number); available_width = header_width_available - mbswidth (page_text, 0); available_width = MAX (0, available_width); lhs_spaces = available_width >> 1; |