gbranden pushed a commit to branch master
in repository groff.
commit a2216fe0c3e9a92501e6f9ded6e76e1e39eb16fc
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sat Oct 12 12:03:09 2024 -0500
[preconv]: Fix incorrect string handling.
* src/preproc/preconv/preconv.cpp (do_file): Fix incorrect handling of
file name string (a post-groff 1.23.0 regression).
---
ChangeLog | 5 +++++
src/preproc/preconv/preconv.cpp | 12 ++++++++----
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d4cb5c37d..221c3fa1d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-10-12 G. Branden Robinson <[email protected]>
+
+ * src/preproc/preconv/preconv.cpp (do_file): Fix incorrect
+ handling of file name string (a post-groff 1.23.0 regression).
+
2024-10-12 G. Branden Robinson <[email protected]>
Rename some test scripts for clarity.
diff --git a/src/preproc/preconv/preconv.cpp b/src/preproc/preconv/preconv.cpp
index cc661c525..cbd9adae1 100644
--- a/src/preproc/preconv/preconv.cpp
+++ b/src/preproc/preconv/preconv.cpp
@@ -1105,13 +1105,17 @@ do_file(const char *filename)
fp = fopen(filename, FOPEN_RB);
reported_filename = "'" + string(filename) + "'";
}
+ char *c_reported_filename = reported_filename.extract();
if (!fp) {
- error("can't open %1: %2", reported_filename.contents(),
- strerror(errno));
+ error("can't open %1: %2", c_reported_filename, strerror(errno));
+ free(c_reported_filename);
return 0;
}
- if (is_debugging)
- fprintf(stderr, "processing %s\n", reported_filename.contents());
+ if (is_debugging) {
+ fprintf(stderr, "processing %s\n", c_reported_filename);
+ fflush(stderr);
+ }
+ free(c_reported_filename);
if (fseek(fp, 0L, SEEK_SET) == 0)
is_seekable = true;
else {
_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit