gbranden pushed a commit to branch master
in repository groff.
commit 0ff9800a5d363b9e2b2b5a2f3778d4185f7adf55
Author: G. Branden Robinson <[email protected]>
AuthorDate: Thu Sep 12 08:10:00 2024 -0500
[troff]: Fix broken `write` request.
* src/roff/troff/input.cpp (do_open): The `write` request, an "unsafe
mode" feature has been broken for a week. (As, possibly, have others
that write to streams.) Revert `static_cast` operators to C-style
casts, which seem to be necessary (sometimes) with groff's bespoke,
pre-STL `dictionary` class implementation. Unfortunately, when static
casts fail, they fail silently, happily handing back null pointers
that you might not notice right away. Fixes problem introduced by me
in commit 3bb13e4752, 4 September.
---
ChangeLog | 12 ++++++++++++
src/roff/troff/input.cpp | 4 ++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 098616397..cb339cbf6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2024-09-12 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/input.cpp (do_open): The `write` request, an
+ "unsafe mode" feature has been broken for a week. (As,
+ possibly, have others that write to streams.) Revert
+ `static_cast` operators to C-style casts, which seem to be
+ necessary (sometimes) with groff's bespoke, pre-STL `dictionary`
+ class implementation. Unfortunately, when static casts fail,
+ they fail silently, happily handing back null pointers that you
+ might not notice right away. Fixes problem introduced by me in
+ commit 3bb13e4752, 4 September.
+
2024-09-11 G. Branden Robinson <[email protected]>
* src/preproc/html/pre-html.cpp (html_system): Improve report of
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 9881f42d2..72589f6f5 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -7214,10 +7214,10 @@ static void do_open(bool append)
filename.contents(),
append ? "appending" : "writing",
strerror(errno));
- fp = static_cast<FILE *>(stream_dictionary.remove(stream));
+ fp = (FILE *)stream_dictionary.remove(stream);
}
else
- fp = static_cast<FILE *>(stream_dictionary.lookup(stream, fp));
+ fp = (FILE *)stream_dictionary.lookup(stream, fp);
if (fp != 0 /* nullptr */ && (fclose(fp) != 0))
error("cannot close file '%1': %2", filename.contents(),
strerror(errno));
_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit