gbranden pushed a commit to branch master
in repository groff.

commit 44d0de30e0100e9922c07dff7031de199a112cc7
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sat Dec 13 17:29:37 2025 -0600

    [troff]: Reject `\s` after `\c` on a line.
    
    * src/roff/troff/input.cpp (token::next): Reject `\s` escape sequence
      after `\c` on an input line.  Throw warning in category "syntax" and
      don't interpret it at all.
---
 ChangeLog                | 6 ++++++
 src/roff/troff/input.cpp | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index df6abf605..4a86b719d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-12-13  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/input.cpp (token::next): Reject `\s` escape
+       sequence after `\c` on an input line.  Throw warning in category
+       "syntax" and don't interpret it at all.
+
 2025-12-13  G. Branden Robinson <[email protected]>
 
        * src/roff/troff/env.cpp (environment::set_font): Move warning
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 7db0fda5f..d08dfda3b 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -2587,6 +2587,12 @@ void token::next()
          have_formattable_input = true;
        break;
       case 's':
+       if (curenv->get_was_line_interrupted()) {
+         warning(WARN_SYNTAX, "ignoring escaped '%1' on input line"
+                 " after output line continuation escape sequence",
+                 char(cc));
+         break;
+       }
        if (read_size(&x))
          curenv->set_size(x);
        if (!want_att_compat)

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

Reply via email to