gbranden pushed a commit to branch master
in repository groff.

commit 81fd7a2a24d68456337dde033a6d3d63dc491661
Author: G. Branden Robinson <[email protected]>
AuthorDate: Thu Dec 25 18:05:07 2025 -0600

    src/roff/troff/input.cpp: Slightly refactor.
    
    * src/roff/troff/input.cpp (do_define_macro): Parallelize wording of
      error diagnostic when encountering EOF inside `ig`nored input, pull it
      into a local `static const` character array, and pass that to our
      diagnostic functions.
---
 ChangeLog                | 7 +++++++
 src/roff/troff/input.cpp | 6 +++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6aae3d7f1..aeb3e38cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2025-12-25  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/input.cpp (do_define_macro): Slightly refactor.
+       Parallelize wording of error diagnostic when encountering EOF
+       inside `ig`nored input, pull it into a local `static const`
+       character array, and pass that to our diagnostic functions.
+
 2025-12-25  G. Branden Robinson <[email protected]>
 
        * src/roff/troff/input.cpp: Trivially refactor.
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 4f2210a49..f469f0cd9 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -5516,11 +5516,11 @@ void do_define_macro(define_mode mode, calling_mode 
calling, comp_mode comp)
          error("end of file while defining macro '%1'", nm.contents());
       }
       else {
+       static const char msg[] = "end of file while ignoring input";
        if (have_start_location)
-         error_with_file_and_line(start_filename, start_lineno,
-                                  "end of file while ignoring input lines");
+         error_with_file_and_line(start_filename, start_lineno, msg);
        else
-         error("end of file while ignoring input lines");
+         error(msg);
       }
       tok.next();
       return;

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

Reply via email to