gbranden pushed a commit to branch master
in repository groff.
commit 017779a9a78ae5890b792b89d3a27a2bbcc864c6
Author: G. Branden Robinson <[email protected]>
AuthorDate: Tue Jul 16 10:03:52 2024 -0500
[troff]: Fix Savannah #65977 (early `device` req).
* src/roff/troff/input.cpp (device_request): Honor a `device` request
even if it precedes any formatted output, as we do the `\X` escape
sequence.
Fixes <https://savannah.gnu.org/bugs/?65977>.
$ printf '.device\n'| ./build/test-groff -Zww
troff: warning: device control request expects arguments
$ printf '.device tty: foo my bar\n'| ./build/test-groff -Zww
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 tty: foo my bar
n12000 0
x trailer
V792000
x stop
$ printf '\\X@tty: foo my bar@\n'| ./build/test-groff -Zww
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 tty: foo my bar
n12000 0
x trailer
V792000
x stop
---
ChangeLog | 8 ++++++++
src/roff/troff/input.cpp | 2 ++
2 files changed, 10 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 6955546f3..5c2bc1927 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-07-16 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/input.cpp (device_request): Honor a `device`
+ request even if it precedes any formatted output, as we do the
+ `\X` escape sequence.
+
+ Fixes <https://savannah.gnu.org/bugs/?65977>.
+
2024-07-16 G. Branden Robinson <[email protected]>
* src/roff/troff/input.cpp (get_long_name): Call
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 6fa1d2388..80968a207 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -5696,6 +5696,8 @@ static void device_request()
if (c != ' ' && c != '\t')
break;
}
+ if (curdiv == topdiv && topdiv->before_first_page)
+ topdiv->begin_page();
for (; c != '\n' && c != EOF; c = get_copy(0 /* nullptr */))
mac.append(c);
curenv->add_node(new special_node(mac));
_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit