gbranden pushed a commit to branch master
in repository groff.

commit 962f25ee8557b10f7f197616f9df85a46d9cabdd
Author: G. Branden Robinson <[email protected]>
AuthorDate: Thu Apr 30 00:04:22 2026 -0500

    [troff]: Fix Savannah #68285.
    
    * src/roff/troff/env.cpp (temporary_indent): When invalidly given no
      argument, the `ti` request was failing to correctly skip the remainder
      of the input line.  Drop two instances of logic that "manually" pump
      the input stream by calling `tok.next()`.  The second is better
      replaced by `skip_line()`, and the first made redundant thereby.
      Nearly all request handlers call that function to consume the
      remainder of the input line once they've handled all the arguments
      they expect.
    
    Fixes <https://savannah.gnu.org/bugs/?68285>.  Problem introduced by me
    in commit ca8c376830, 2024-11-09.  I altered request handlers for four
    requests in that commit: `pn`, `ti`, `rchar`, and `hpfcode`, but
    fortunately made this mistake only with `ti`.
---
 ChangeLog              | 19 +++++++++++++++++++
 src/roff/troff/env.cpp |  5 +----
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 26f75002b..f39fdbc28 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2026-04-30  G. Branden Robinson <[email protected]>
+
+       [troff]: Fix Savannah #68285.
+
+       * src/roff/troff/env.cpp (temporary_indent): When invalidly
+       given no argument, the `ti` request was failing to correctly
+       skip the remainder of the input line.  Drop two instances of
+       logic that "manually" pump the input stream by calling
+       `tok.next()`.  The second is better replaced by `skip_line()`,
+       and the first made redundant thereby.  Nearly all request
+       handlers call that function to consume the remainder of the
+       input line once they've handled all the arguments they expect.
+
+       Fixes <https://savannah.gnu.org/bugs/?68285>.  Problem
+       introduced by me in commit ca8c376830, 2024-11-09.  I altered
+       request handlers for four requests in that commit: `pn`, `ti`,
+       `rchar`, and `hpfcode`, but fortunately made this mistake only
+       with `ti`.
+
 2026-04-29  G. Branden Robinson <[email protected]>
 
        [groff]: Regression-test Savannah #68285.
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index cad5de9a4..2e7341697 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -1701,9 +1701,6 @@ void temporary_indent() // .ti
     }
     if (!read_hunits(&temp, 'm', curenv->get_indent()))
       is_valid = false;
-    // XXX: Why not `skip_line()`?
-    while (!tok.is_terminator())
-      tok.next();
   }
   if (was_invoked_with_regular_control_character)
     curenv->do_break();
@@ -1717,7 +1714,7 @@ void temporary_indent() // .ti
     curenv->have_temporary_indent = true;
     curdiv->modified_tag.incl(MTSM_TI);
   }
-  tok.next(); // XXX: Why not `skip_line()`?
+  skip_line();
 }
 
 void configure_underlining(bool want_spaces_underlined)

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

Reply via email to