emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#9347: closed (PR(1) -t/-T negates :STOP_PAGE)


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#9347: closed (PR(1) -t/-T negates :STOP_PAGE)
Date: Tue, 23 Aug 2011 23:31:02 +0000

Your message dated Wed, 24 Aug 2011 00:27:34 +0100
with message-id <address@hidden>
and subject line Re: bug#9347: PR(1) -t/-T negates :STOP_PAGE
has caused the GNU bug report #9347,
regarding PR(1) -t/-T negates :STOP_PAGE
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
9347: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9347
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: PR(1) -t/-T negates :STOP_PAGE Date: Mon, 22 Aug 2011 22:58:17 -0700 User-agent: Heirloom mailx 12.4 7/29/08
The issue:
Running pr(1) with eith the -t or -T options appears to negate the --page
option's :LAST_PAGE optional argument.  The documentation does not mention
this effect; either the documentation or the program should be updated to
address this.

Illustration of issue:

$ wc -l foo
144 foo
$ pr +1:1 foo | wc -l
66
$ pr +1:1 -t foo | wc -l
144
$ pr +1:1 -T foo | wc -l
144

Version and system info:

$ pr --version | head -n1
pr (GNU coreutils) 7.4
$ uname -a
Linux thinkcentre 2.6.32-33-generic #72-Ubuntu SMP Fri Jul 29 21:08:37 UTC 2011 
i686 GNU/Linux



--- End Message ---
--- Begin Message --- Subject: Re: bug#9347: PR(1) -t/-T negates :STOP_PAGE Date: Wed, 24 Aug 2011 00:27:34 +0100 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20110707 Thunderbird/5.0
On 08/23/2011 03:18 PM, Pádraig Brady wrote:
> On 08/23/2011 06:58 AM, address@hidden wrote:
>> The issue:
>> Running pr(1) with eith the -t or -T options appears to negate the --page
>> option's :LAST_PAGE optional argument.  The documentation does not mention
>> this effect; either the documentation or the program should be updated to
>> address this.
>>
>> Illustration of issue:
>>
>> $ wc -l foo
>> 144 foo
>> $ pr +1:1 foo | wc -l
>> 66
>> $ pr +1:1 -t foo | wc -l
>> 144
>> $ pr +1:1 -T foo | wc -l
>> 144
>>
>> Version and system info:
>>
>> $ pr --version | head -n1
>> pr (GNU coreutils) 7.4
>> $ uname -a
>> Linux thinkcentre 2.6.32-33-generic #72-Ubuntu SMP Fri Jul 29 21:08:37 UTC 
>> 2011 i686 GNU/Linux
> 
> This looks like a bug, since `pr +2 -T` does skip the first page.
> I.E. -tT should be independent of those page ranges.
> 
> The following seems to work, and pass tests.
> cheers,
> Pádraig.
> 
> diff --git a/src/pr.c b/src/pr.c
> index 771418c..d1adc55 100644
> --- a/src/pr.c
> +++ b/src/pr.c
> @@ -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;

I applied the above with a test, so I'm closing this.

cheers,
Pádraig.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]