gbranden pushed a commit to branch master
in repository groff.

commit 7744a8f8e47142f72ebcd7d45f92f9665bc53569
Author: G. Branden Robinson <[email protected]>
AuthorDate: Thu Feb 5 09:35:49 2026 -0600

    [troff]: Fix Savannah #68017.
    
    * src/roff/troff/number.cpp (is_valid_term): Reintroduce warning in
      category "tab" when a tab character starts a numeric expression.
      Lacking it caused the formatter to throw a huge number of error
      diagnostics (with no harmful effect on formatting, thus unproductively
      alarming the user) when springing traps in Matt Bishop's vintage "mn"
      macro package.
    
    Fixes <https://savannah.gnu.org/bugs/?68017>.  Partially reverts commit
    64711b3a875, 14 November.
---
 ChangeLog                 | 12 ++++++++++++
 src/roff/troff/number.cpp |  5 +++++
 2 files changed, 17 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 2f93ffe08..2ff8416f7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2026-02-05  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/number.cpp (is_valid_term): Reintroduce warning
+       in category "tab" when a tab character starts a numeric
+       expression.  Lacking it caused the formatter to throw a huge
+       number of error diagnostics (with no harmful effect on
+       formatting, thus unproductively alarming the user) when
+       springing traps in Matt Bishop's vintage "mn" macro package.
+
+       Fixes <https://savannah.gnu.org/bugs/?68017>.  Partially reverts
+       commit 64711b3a875, 14 November.
+
 2026-01-20  Deri James  <[email protected]>
 
        Change location of the Inline::C build directory
diff --git a/src/roff/troff/number.cpp b/src/roff/troff/number.cpp
index 0cc58dbc9..21b6b3e93 100644
--- a/src/roff/troff/number.cpp
+++ b/src/roff/troff/number.cpp
@@ -380,6 +380,11 @@ static bool is_valid_term(units *u, int scaling_unit,
       tok.next();
       is_negative = !is_negative;
     }
+    else if (tok.is_tab()) {
+      warning(WARN_TAB, "ignoring numeric expression starting with %1",
+             tok.description());
+      return false;
+    }
     else
       break;
   int c = tok.ch(); // safely compares to char literals; TODO: grochar

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

Reply via email to