gbranden pushed a commit to branch master
in repository groff.

commit 4484097d3aafe0908c2f1c2227e7f66602ce8905
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Aug 19 16:27:31 2024 -0500

    [troff]: Put fewer newlines on input stack. (2/2)
    
    * src/roff/troff/input.cpp (do_overstrike, do_bracket, do_name_test)
      (do_expr_test, do_zero_width_output, do_width, do_device_control):
      Similarly when finishing up with a delimited escape sequence with a
      malformed ending.
---
 ChangeLog                |  4 ++++
 src/roff/troff/input.cpp | 13 -------------
 2 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ca4778c12..225b9c3be 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,10 @@
        (do_device_control): Stop pushing a newline onto the input stack
        when encountering one; this character can no longer serve double
        duty as a delimiter and a formattable newline.
+       (do_overstrike, do_bracket, do_name_test, do_expr_test)
+       (do_zero_width_output, do_width, do_device_control): Similarly
+       when finishing up with a delimited escape sequence with a
+       malformed ending.
 
 2024-08-19  G. Branden Robinson <[email protected]>
 
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index f4c367e9e..b06d1a897 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -1585,8 +1585,6 @@ node *do_overstrike() // \o
              " escape sequence; expected %1, got %2", delimdesc,
              tok.description());
       free(delimdesc);
-      // Synthesize an input line ending.
-      input_stack::push(make_temp_iterator("\n"));
       break;
     }
     if (tok == start_token
@@ -1632,8 +1630,6 @@ static node *do_bracket() // \b
              " bracket-building escape sequence; expected %1, got"
              " %2", delimdesc, tok.description());
       free(delimdesc);
-      // Synthesize an input line ending.
-      input_stack::push(make_temp_iterator("\n"));
       break;
     }
     if (tok == start_token
@@ -1669,8 +1665,6 @@ static bool do_name_test() // \A
              " validation escape sequence; expected %1, got %2",
              delimdesc, tok.description());
       free(delimdesc);
-      // Synthesize an input line ending.
-      input_stack::push(make_temp_iterator("\n"));
       break;
     }
     if (tok == start_token
@@ -1713,7 +1707,6 @@ static bool do_expr_test() // \B
              " expression validation escape sequence; expected %1,"
              " got %2", delimdesc, tok.description());
       free(delimdesc);
-      input_stack::push(make_temp_iterator("\n"));
       break;
     }
     tok.next();
@@ -1782,8 +1775,6 @@ static node *do_zero_width_output() // \Z
              " output escape sequence; expected %1, got %2", delimdesc,
              tok.description());
       free(delimdesc);
-      // Synthesize an input line ending.
-      input_stack::push(make_temp_iterator("\n"));
       break;
     }
     if (tok == start_token
@@ -5531,8 +5522,6 @@ static void do_width() // \w
              "computation escape sequence; expected %1, got %2",
              delimdesc, tok.description());
       free(delimdesc);
-      // Synthesize an input line ending.
-      input_stack::push(make_temp_iterator("\n"));
       break;
     }
     if (tok == start_token
@@ -5755,8 +5744,6 @@ static node *do_device_control() // \X
              " escape sequence; expected %1, got %2", delimdesc,
              tok.description());
       free(delimdesc);
-      // Synthesize an input line ending.
-      input_stack::push(make_temp_iterator("\n"));
       break;
     }
     if (tok == start_token

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

Reply via email to