gbranden pushed a commit to branch master
in repository groff.

commit dc77ec76b64828e898c55f666368ee5047273ac9
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Nov 17 23:46:55 2025 -0600

    [troff]: Drop overly aggressive assertion.
    
    * src/roff/troff/input.cpp (length_request): Drop erroneous assertion,
      while failed and cored on `.length \&`.
    
    Fixes:
    
    $ printf '.length \\&\n' | ./build/test-groff
    troff:<standard input>:1: error: expected identifier, got an escaped '&'; 
treated as missing
    troff: ../src/roff/troff/input.cpp:5698: void length_request(): Assertion 
`ret != 0' failed.
    /.../build/groff: error: troff: Aborted (core dumped)
---
 ChangeLog                | 5 +++++
 src/roff/troff/input.cpp | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 7b17fa3b1..508c9950b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2025-11-17  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/input.cpp (length_request): Drop erroneous
+       assertion, while failed and cored on `.length \&`.
+
 2025-11-17  G. Branden Robinson <[email protected]>
 
        * src/roff/troff/input.cpp: Trivially refactor.  Rename
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index c4f1b0bdb..c829edba3 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -5695,8 +5695,8 @@ void length_request()
   }
   symbol ret;
   ret = get_name();
-  assert(ret != 0 /* nullptr */);
   if (ret.is_null()) {
+    // The identifier was garbage, like `a\&b`.
     skip_line();
     return;
   }

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

Reply via email to