bug-coreutils
[Top][All Lists]
Advanced

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

bug#47243: pr lacks -p


From: Collin Funk
Subject: bug#47243: pr lacks -p
Date: Tue, 29 Jul 2025 21:51:04 -0700
User-agent: Gnus/5.13 (Gnus v5.13)

Paul Eggert <eggert@cs.ucla.edu> writes:

>> +After printing each page, print an alert (bell) to standard error and
>> +wait for a newline to be read from @file{/dev/tty} before printing the
>> +next page.
>
> This sentence should start "Before" not "After", with the rest of the
> sentence changed accordingly. There is no bell printed after the last
> page.
>
> Looking at the code, it seems that this mistake has leaked into the
> code as well, in that sometimes 'pr' will print an alert and wait for
> '\n' at end of file, when there is no page to print. If I'm right,
> that needs to be fixed; pr should wait for '\n' only if it will
> actually print something afterward.

Fixing this required a bit more understanding of the code on my part,
but I think the attached patch should address it.

The existing code uses a 'pad_vertically' variable to keep track of
whether the current page has text or a header that needs to be
printed. Therefore, any time we set it to true, we must also pause. But
only once, at the start of the page.

Collin

Attachment: v5-0001-pr-implement-p-and-modify-f-conforming-to-POSIX.patch
Description: Text Data


reply via email to

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