URL:
<https://savannah.gnu.org/bugs/?64466>
Summary: [ms] poorly diagnosed diversion error
Group: GNU roff
Submitter: barx
Submitted: Mon 24 Jul 2023 09:27:01 AM CDT
Category: Macro ms
Severity: 2 - Minor
Item Group: Warning/Suspicious behaviour
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Planned Release: None
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Mon 24 Jul 2023 09:27:01 AM CDT By: Dave <barx>
Reported by Doug McIlroy, some time ago
(http://lists.gnu.org/r/bug-groff/2011-03/msg00012.html).
$ cat test.ms
.LP
.KS
.KF
.KE
$ groff -ms test.ms > /dev/null
s.tmac:test.ms:3: error: .KF while diversion open (recovering)
$ sed s/KF/KS/ test.ms | groff -ms > /dev/null
s.tmac: error: diversion open while ejecting page (last file seen: <standard
input>) (recovering)
There was no follow-up on the list, and while the error text has improved a
bit since 1.20.1, the second error is still not as helpful as the first, and
it seems (says someone who has never looked at the ms code) a simple enough
condition to detect earlier (presuming .KS can't legally nest).
Reordering the lines has a similar effect to the one Doug observed:
$ sed -n '1p; 2h; 3{p;g;p}; 4p' test.ms | groff -ms > /dev/null
s.tmac: error: diversion open while ejecting page (last file seen: <standard
input>) (recovering)
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?64466>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/