#1040250 coreutils: tail: legacy flag format broken with empty number field

Package:
coreutils
Source:
coreutils
Description:
GNU core utilities
Submitter:
наб
Date:
2023-07-03 21:12:04 UTC
Severity:
normal
#1040250#5
Date:
2023-07-03 21:09:58 UTC
From:
To:
Dear Maintainer,

The V7 (&a.) flag format is, nominally
  tail [ ±number[lbc][fr] ] [ file ]
(https://www.tuhs.org/cgi-bin/utree.pl?file=4.1cBSD/usr/man/man1/tail.1).

An empty number field is equivalent to a zero (the documentation is a
meme, but cf. third-party analysis at
https://mail-index.netbsd.org/tech-userlevel/2023/06/30/msg013953.html
or, well, just run v7:
  # echo abcdefghijklmnopqrstuvwxyz > f
  # tail +c f
  abcdefghijklmnopqrstuvwxyz
  # tail +10c f
  jklmnopqrstuvwxyz
).

However, coreutils tail somehow takes it to mean... 10?
(Thus, coreutils tail +c f is the same as V7 tail +10c.)

Consider not doing that.

Best,
наб