gbranden pushed a commit to branch master
in repository groff.
commit f1e603870c1352995bb109321051713bcb283343
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sat Jul 13 04:07:55 2024 -0500
[troff]: Fix Savannah #65983.
* src/roff/troff/input.cpp (file_iterator::set_location): Stop
initializing the output. Preprocessing empty documents could lead to
baffling results. In groff 1.22.4 and before, you'd get a blank
document from some output drivers despite no evident reason from the
preprocessed input that this should be the case. In groff 1.23.0,
this happened for fewer output drivers but still generated a
mysterious diagnostic.
fatal error: 'V' command invalid before first 'p' command
It turns out to be unnecessary to initialize `the_output` upon
encountering an `lf` request. The spurious output aspect of the
problem dates back to commit e092fba4517, 6 February 2000
{"groff pre-1.16"}.
Fixes <https://savannah.gnu.org/bugs/?65983>.
---
ChangeLog | 19 +++++++++++++++++++
src/roff/troff/input.cpp | 6 +-----
2 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 0312f3424..78650bf77 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2024-07-13 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/input.cpp (file_iterator::set_location): Stop
+ initializing the output. Preprocessing empty documents could
+ lead to baffling results. In groff 1.22.4 and before, you'd get
+ a blank document from some output drivers despite no evident
+ reason from the preprocessed input that this should be the case.
+ In groff 1.23.0, this happened for fewer output drivers but
+ still generated a mysterious diagnostic.
+
+ fatal error: 'V' command invalid before first 'p' command
+
+ It turns out to be unnecessary to initialize `the_output` upon
+ encountering an `lf` request. The spurious output aspect of the
+ problem dates back to commit e092fba4517, 6 February 2000
+ {"groff pre-1.16"}.
+
+ Fixes <https://savannah.gnu.org/bugs/?65983>.
+
2024-07-13 G. Branden Robinson <[email protected]>
* src/roff/troff/env.cpp (number_lines): Clarify diagnostics;
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index e460b7340..9a3e51d65 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -512,12 +512,8 @@ void file_iterator::backtrace()
bool file_iterator::set_location(const char *f, int ln)
{
- if (f) {
+ if (f)
filename = f;
- if (!the_output)
- init_output();
- the_output->put_filename(f, 0);
- }
lineno = ln;
return true;
}
_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit