bug-coreutils
[Top][All Lists]
Advanced

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

bug#81225: pr: +0 is interpreted as file name


From: Pádraig Brady
Subject: bug#81225: pr: +0 is interpreted as file name
Date: Fri, 12 Jun 2026 13:27:04 +0100
User-agent: Mozilla Thunderbird Beta

On 12/06/2026 09:37, Daniel Hofstetter wrote:
Hi,

I noticed that pr interprets +0 as a file name and not as +FIRST_PAGE.
And so a "no such file" error is shown whereas --pages=0 shows an
"invalid page range" error.

$ echo "foo" > foo
$ pr +0 foo
pr: +0: No such file or directory
[snipped pr output of the "foo" file]
$ pr --pages=0 foo
pr: invalid page range ‘0’

I'm using coreutils 9.11.

+... could be a file name, so we treat +<invalid page> as a file
since: https://github.com/coreutils/coreutils/commit/48eaa7382

--pages=0 is diagnosed directly as an invalid range
as there can be no ambiguity there.

So the inconsistency is due to a feature,
allowing users to `pr +foo --option` for example.

Adjusting this now could introduce some breakage,
and I don't see much benefit to changing this.

Oh this is probably coming from uutils
partially supporting the fallback.
It would be good to give that context when reporting bugs.

I've pushed the attached test to the GNU test suite,
to verify this handling.

Marking this as done.

thanks,
Padraig

Attachment: pr-invalid-pages.patch
Description: Text Data


reply via email to

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