[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Two trivial questions
From: |
Dave Kemper |
Subject: |
Re: Two trivial questions |
Date: |
Mon, 8 Nov 2021 03:39:23 -0600 |
On 10/28/21, Ralph Corderoy <ralph@inputplus.co.uk> wrote:
> Perhaps the code is doing the equivalent of atoi(3) and ignoring errors
> rather than something more akin to strtol(3) with care to prime errno(3)
> beforehand.
Yeah, in fact, groff ignores numbers following several marks of
punctuation besides the comma, and warns about none, even with all
warnings turned on.
$ printf '.ps 12\nword\n' | groff -Z -ww > test.out
$ printf '.ps 12.5\nword\n' | groff -Z -ww | diff - test.out | wc
8 12 54
$ printf '.ps 12,5\nword\n' | groff -Z -ww | diff - test.out | wc
0 0 0
$ printf '.ps 12#5\nword\n' | groff -Z -ww | diff - test.out | wc
0 0 0
$ printf '.ps 12^5\nword\n' | groff -Z -ww | diff - test.out | wc
0 0 0
$ printf '.ps 12_5\nword\n' | groff -Z -ww | diff - test.out | wc
0 0 0
$ printf '.ps 12;5\nword\n' | groff -Z -ww | diff - test.out | wc
0 0 0
$ printf '.ps 12!5\nword\n' | groff -Z -ww | diff - test.out | wc
0 0 0
$ printf '.ps 12@5\nword\n' | groff -Z -ww | diff - test.out | wc
0 0 0
> Sounds like a bug.
Bug, or undocumented commenting feature? Groff also happily ignores
any additional parameters given to .ps:
$ printf '.ps 12 some garbage\nword\n' | groff -Z -ww | diff - test.out | wc
0 0 0
- Re: Two trivial questions,
Dave Kemper <=