URL: <https://savannah.gnu.org/bugs/?68787>
Summary: [troff] `lf` request could validate its arguments
better
Group: GNU roff
Submitter: gbranden
Submitted: Sat 17 Oct 2026 02:10:55 PM UTC
Category: Formatter
Severity: 3 - Normal
Item Group: Warning/Suspicious behaviour
Status: In Progress
Privacy: Public
Assigned to: gbranden
Open/Closed: Open
Discussion Lock: Unlocked
Planned Release: None
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Sat 17 Oct 2026 02:10:55 PM UTC By: G. Branden Robinson <gbranden>
We could throw warning diagnostics, or better ones, when:
1. The `lf` request is given no arguments at all; and
2. the `lf` request is given a second argument (for the file name) that
interpolates empty.
The request _behaves_ correctly; an empty (cf. absent) file name is ignored.
Exhibit:
$ groff -ww
.lf
troff:<standard input>:1: warning: numeric expression missing [-w missing]
.ds empty \" empty
.lf 42 \*[empty]
.pi
troff:<standard input>:42: warning: output piping request expects a system
command as argument [-w missing]
Here we see that `lf` without arguments _does_ produce a diagnostic, but it's
a relatively unhelpful one from down in the numeric expression evaluator,
which knows almost nothing about the syntactical context.
We also see that the empty string interpolated as the "new" file name was
correctly ignored; it did not clobber "<standard input>".
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?68787>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
