gbranden pushed a commit to branch master
in repository groff.

commit 9665a3a7fc700dcdab63ddf01fdb3106b646117a
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sat Dec 13 15:58:36 2025 -0600

    Revert "[troff]: Add assertion."
    
    This reverts commit 75321a3ab4a779cc542c91cbc304b372774243f4.
    
    I was wrong; the scenario described (hyphenation is attempted on a line
    with no nodes in it) _can_ happen.  I happened upon it by accident when
    trying to format the "meref.me" document on a terminal while forgetting
    to load the me(7) macro package.  This produced a badly corrupted
    document; the aforementioned scenario appears to involve use of a
    diversion with an indentation greater than the line length.  This likely
    is not a practical text formatting scenario, but impractical scenarios
    should not crash the formatter.  Delete the assertion.
    
    Fixes:
    
    $ ~/groff-HEAD/bin/groff -T utf8 -a ./build/doc/meref.me
    troff: ../src/roff/troff/env.cpp:2171: void 
environment::possibly_hyphenate_line(bool): Assertion `*startp != 0' failed.
    /.../groff-HEAD/bin/groff: error: troff: Aborted (core dumped)
---
 ChangeLog              | 7 -------
 src/roff/troff/env.cpp | 1 -
 2 files changed, 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b6a50f5f0..207c765c2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2693,13 +2693,6 @@
          (hyphenation): Mark function as `static`.
        * src/roff/troff/node.h: Drop declaration.
 
-2025-10-04  G. Branden Robinson <[email protected]>
-
-       * src/roff/troff/env.cpp (environment::hyphenate_line): Add
-       assertion for an apparently impossible scenario.  The formatter
-       should not attempt to hyphenate an output line with no nodes in
-       it.  An output line containing no nodes is nonsense.
-
 2025-09-30  G. Branden Robinson <[email protected]>
 
        * tmac/an-ext.tmac: Tweak `EX`/`EE` behavior for more flexible
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index c66b7ea8c..df844cc42 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -2168,7 +2168,6 @@ void environment::possibly_hyphenate_line(bool 
must_break_here)
        break;
       prev_type = this_type;
     }
-  assert(*startp != 0 /* nullptr */);
   if (*startp == 0 /* nullptr */)
     return;
   node *tem = *startp;

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

Reply via email to