URL:
<https://savannah.gnu.org/bugs/?65138>
Summary: [troff] `device` request silently fails before first
page begins
Group: GNU roff
Submitter: gbranden
Submitted: Mon 08 Jan 2024 10:37:59 AM UTC
Category: Core
Severity: 3 - Normal
Item Group: Warning/Suspicious behaviour
Status: In Progress
Privacy: Public
Assigned to: gbranden
Open/Closed: Open
Discussion Lock: Any
Planned Release: None
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Mon 08 Jan 2024 10:37:59 AM UTC By: G. Branden Robinson <gbranden>
Affects _groff_ 1.22.4.
$ /usr/bin/groff --version | head -n 1
GNU groff version 1.22.4
$ printf '.device pdf: foobar\n' | /usr/bin/groff -ww -Z
x T ps
x res 72000 1 1
x init
p1
x trailer
V792000
x stop
Situations like this seem to be handled in _div.cpp_ with a fairly casually
worded fatal error message.
$ git grep -C1 sorry src/roff/troff/div.cpp
src/roff/troff/div.cpp- if (before_first_page && begin_page())
src/roff/troff/div.cpp: fatal("sorry, I didn't manage to begin the first
page in time: use an explicit .br request");
src/roff/troff/div.cpp- vertical_size v(vs, post_vs);
--
src/roff/troff/div.cpp- // This can only happen with the .output request.
src/roff/troff/div.cpp: fatal("sorry, I didn't manage to begin the first
page in time: use an explicit .br request");
src/roff/troff/div.cpp- const char *s = asciify(c);
--
src/roff/troff/div.cpp- if (before_first_page && begin_page())
src/roff/troff/div.cpp: fatal("sorry, I didn't manage to begin the first
page in time: use an explicit .br request");
src/roff/troff/div.cpp- the_output->copy_file(page_offset, vertical_position,
filename);
But it gives the user sound advice.
$ printf '.br\n.device pdf: foobar\n' | /usr/bin/groff -ww -Z
x T ps
x res 72000 1 1
x init
p1
V12000
H72000
x font 5 TR
f5
s10000
V12000
H72000
md
DFd
x X pdf: foobar
n12000 0
x trailer
V792000
x stop
I bet myself that `fl` would work, too, and I won!
$ printf '.fl\n.device pdf: foobar\n' | /usr/bin/groff -ww -Z
x T ps
x res 72000 1 1
x init
p1
V12000
H72000
x font 5 TR
f5
s10000
V12000
H72000
md
DFd
x X pdf: foobar
n12000 0
x trailer
V792000
x stop
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?65138>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/