gbranden pushed a commit to branch master
in repository groff.

commit 59261beacf23d82ed1559ccf31e643b1e4482c2b
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sun Nov 1 19:06:04 2026 -0600

    XXX [troff]: Fix Savannah #68361. (style-warn if `\\` encountered in 
interpretation mode)
    
    * src/roff/troff/input.cpp (token::next): Throw warning in category
      "style" if the input uses `\\` to try to format a backslash, which is
      not reliable if the escape character is changed (you then get _two_
      backslashes instead).  Emit warning in category "escape" if
      encountering an escaped dot.  This member function operates only in
      interpretation mode, so no false positives occur when using `\` to
      escape a dot in copy mode, as is sometimes done when nesting macro
      definitions.
---
 src/roff/troff/input.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 587238ce8..8b770697e 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -2945,7 +2945,12 @@ void token::next()
        }
        goto handle_ordinary_char;
       default:
-       if ((cc != escape_char) && (cc != '.'))
+       if (cc == escape_char)
+         warning(WARN_STYLE, "use a special character escape sequence"
+                 " to format the escape character,"
+                 " or use requests"
+                 " to change or disable the escape character");
+       else
          warning(WARN_ESCAPE, "ignoring escape character before %1",
                  input_char_description(cc));
        goto handle_ordinary_char;

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

Reply via email to