gbranden pushed a commit to branch master
in repository groff.

commit 613941492890f7829a2ac301dcc644d9e492e7a6
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sat Oct 17 13:14:12 2026 -0500

    [troff]: Fix Savannah #68788.
    
    * src/roff/troff/input.cpp (read_line_rule_expression): Throw error
      diagnostic if input attempts to draw a rule with `\l` or `\L` with an
      argument that isn't a character.
    
    Fixes <https://savannah.gnu.org/bugs/?68788>.
---
 ChangeLog                | 8 ++++++++
 src/roff/troff/input.cpp | 5 +++++
 2 files changed, 13 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 6ed1d2064..48c7a3f16 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2026-10-17  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/input.cpp (read_line_rule_expression): Throw
+       error diagnostic if input attempts to draw a rule with `\l` or
+       `\L` with an argument that isn't a character.
+
+       Fixes <https://savannah.gnu.org/bugs/?68788>.
+
 2026-10-17  G. Branden Robinson <[email protected]>
 
        [groff]: Regression-test Savannah #68788.
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index a3bba53a0..60d79f5b0 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -6303,6 +6303,11 @@ static bool read_line_rule_expression(units *n, unsigned 
char si,
       tok.next();
     if (!(start_token == tok
          && input_stack::get_level() == start_level)) {
+      if (!tok.is_any_character()) {
+       error("cannot use %1 to draw a line of glyphs",
+             tok.description());
+       return false;
+      }
       *cip = tok.get_charinfo(true /* is_mandatory */);
       if (0 /* nullptr */ == *cip)
        assert(0 == "attempted to use token without charinfo in"

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

Reply via email to