gbranden pushed a commit to branch master
in repository groff.

commit ba09082988531e629685f86375563d64f7cf1244
Author: G. Branden Robinson <[email protected]>
AuthorDate: Wed Mar 11 18:49:48 2026 -0500

    [troff]: Improve error diagnostic.
    
    * src/roff/troff/number.cpp (is_valid_term): Improve error diagnostic
      when encountering an invalid character in a numeric expression; say
      "containing", not "starting with".
    
    Illustration:
    
    $ echo '.nr a 2 +' | groff
    troff:<standard input>:1: error: ignoring invalid numeric expression 
starting with a newline
    
    $ echo '.nr a 2 +' | ./build/test-groff
    troff:<standard input>:1: error: ignoring invalid numeric expression 
containing a newline
---
 ChangeLog                 | 6 ++++++
 src/roff/troff/number.cpp | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 117651fc5..0d399bfaa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2026-03-11  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/number.cpp (is_valid_term): Improve error
+       diagnostic when encountering an invalid character in a numeric
+       expression; say "containing", not "starting with".
+
 2026-03-13  Deri James  <[email protected]>
 
        Use sequential tag names to avoid possible random duplicates.
diff --git a/src/roff/troff/number.cpp b/src/roff/troff/number.cpp
index 21b6b3e93..a039ceed7 100644
--- a/src/roff/troff/number.cpp
+++ b/src/roff/troff/number.cpp
@@ -495,7 +495,7 @@ static bool is_valid_term(units *u, int scaling_unit,
     *u = 0;
     return !is_mandatory;
   default:
-    error("ignoring invalid numeric expression starting with %1",
+    error("ignoring invalid numeric expression containing %1",
          tok.description());
     return false;
   }

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

Reply via email to