gbranden pushed a commit to branch master
in repository groff.

commit 76b1179d8388fb969a7df0180555ed98d84c8bcc
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Jun 27 19:53:10 2022 -0500

    src/preproc/html/pre-html.cpp: Die on fclose fail.
    
    * src/preproc/html/pre-html.cpp (do_file): Die if `fclose()` fails; such
      a situation suggests a pretty hosed environment.
---
 ChangeLog                     | 5 +++++
 src/preproc/html/pre-html.cpp | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 3a30c3d7..5ea1418e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2022-06-28  G. Branden Robinson <[email protected]>
 
+       * src/preproc/html/pre-html.cpp (do_file): Die if `fclose()`
+       fails; such a situation suggests a pretty hosed environment.
+
+2022-06-27  G. Branden Robinson <[email protected]>
+
        * src/preproc/html/pre-html.cpp (checkImageDir): If `mkdir()`
        fails, use `strerror()` to report the underlying problem.
 
diff --git a/src/preproc/html/pre-html.cpp b/src/preproc/html/pre-html.cpp
index 1da57652..3cd7b2ff 100644
--- a/src/preproc/html/pre-html.cpp
+++ b/src/preproc/html/pre-html.cpp
@@ -1736,7 +1736,8 @@ static bool do_file(const char *filename)
   }
   inputFile.read_file(fp);
   if (fp != stdin)
-    fclose(fp);
+    if (fclose(fp) != 0)
+      sys_fatal("fclose");
   current_filename = 0 /* nullptr */;
   return true;
 }

_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to