Update of bug #68361 (group groff):

                 Summary: [troff] want style warning when `\.` or `\\` used in
interpretation mode => [PATCH] [troff] want style warning when `\.` or `\\`
used in interpretation mode

    _______________________________________________________

Follow-up Comment #2:


commit c59bc5142d35878dc10860d7e221d672119cd93c (HEAD -> gbr-post-1.25)
Author: G. Branden Robinson <[email protected]>
Date:   Sun Nov 1 19:06:04 2026 -0600

    XXX [troff]: Fix Savannah #68361.
    
    * 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.

diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index c53360fb5..2f69001e5 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -2938,7 +2938,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;




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?68361>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to