gbranden pushed a commit to branch master
in repository groff.

commit 642c0168b2e9831df241c0259e542c822e236adb
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sat Jul 13 05:16:34 2024 -0500

    [eqn,troff]: Improve startup file diagnostics.
    
    * src/preproc/eqn/main.cpp (main):
    * src/roff/troff/input.cpp (process_startup_file): Throw error
      diagnostic when a startup file cannot be opened for some reason
      other than its nonexistence.
---
 ChangeLog                | 7 +++++++
 src/preproc/eqn/main.cpp | 3 +++
 src/roff/troff/input.cpp | 3 +++
 3 files changed, 13 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index b672fe963..b57b115d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-07-13  G. Branden Robinson <[email protected]>
+
+       * src/preproc/eqn/main.cpp (main):
+       * src/roff/troff/input.cpp (process_startup_file): Throw error
+       diagnostic when a startup file cannot be opened for some reason
+       other than its nonexistence.
+
 2024-07-13  G. Branden Robinson <[email protected]>
 
        * src/preproc/grn/main.cpp (conv):
diff --git a/src/preproc/eqn/main.cpp b/src/preproc/eqn/main.cpp
index b2c43e938..2b81b8877 100644
--- a/src/preproc/eqn/main.cpp
+++ b/src/preproc/eqn/main.cpp
@@ -453,6 +453,9 @@ int main(int argc, char **argv)
        fatal("cannot close '%1': %2", STARTUP_FILE, strerror(errno));
       free(path);
     }
+    else
+      error("cannot open startup file '%1': %2", STARTUP_FILE,
+           strerror(errno));
   }
   if (optind >= argc)
     do_file(stdin, "-");
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 69d2efbbd..c558b8681 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -8069,6 +8069,9 @@ static void process_startup_file(const char *filename)
     tok.next();
     process_input_stack();
   }
+  else if (errno != ENOENT)
+    error("cannot open startup file '%1': %2", filename,
+         strerror(errno));
   mac_path = orig_mac_path;
 }
 

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

Reply via email to