gbranden pushed a commit to branch master
in repository groff.
commit 184d1b3f950398aae45eef49676b721aeeae2b15
Author: G. Branden Robinson <[email protected]>
AuthorDate: Wed Nov 27 05:20:26 2024 -0600
[pre-grohtml]: Fix noisy error message.
* src/preproc/html/pre-html.cpp (do_file): Nullify `current_filename` on
failure to open file. Fixes noise in error message.
Before:
$ ./build/pre-grohtml nonexistent
./build/pre-grohtml:nonexistent: error: unable to open 'nonexistent': No
such file or directory
After:
$ ./build/pre-grohtml nonexistent
./build/pre-grohtml: error: unable to open 'nonexistent': No such file or
directory
---
ChangeLog | 6 ++++++
src/preproc/html/pre-html.cpp | 1 +
2 files changed, 7 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 862ee14e3..49223db57 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-11-27 G. Branden Robinson <[email protected]>
+
+ * src/preproc/html/pre-html.cpp (do_file): Nullify
+ `current_filename` on failure to open file. Fixes noise in
+ error message.
+
2024-11-27 G. Branden Robinson <[email protected]>
[grohtml]: Rename the `-U` option provided by Takuji to `-k`,
diff --git a/src/preproc/html/pre-html.cpp b/src/preproc/html/pre-html.cpp
index a3b933406..6a35e8158 100644
--- a/src/preproc/html/pre-html.cpp
+++ b/src/preproc/html/pre-html.cpp
@@ -1777,6 +1777,7 @@ static bool do_file(const char *filename)
else {
fp = fopen(filename, "r");
if (0 /* nullptr*/ == fp) {
+ current_filename = 0 /* nullptr */;
error("unable to open '%1': %2", filename, strerror(errno));
return false;
}
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit