Follow-up Comment #11, bug #67372 (group groff):

Hi Ingo,

Here's a proof-of-concept patch, fixing up only the `\A` escape sequence.


$ git diff
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 56877ffad..cb3472792 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -1700,6 +1700,12 @@ static node *do_bracket() // \b
 
 static const char *do_name_test() // \A
 {
+  assert(escape_char != 0);
+  if ((input_stack::peek() == escape_char) && !want_att_compat) {
+    warning(WARN_DELIM, "identifier validation escape sequence"
+           " expected a delimiter, got an escape character");
+    return 0 /* nullptr */;
+  }
   int start_level = input_stack::get_level();
   token start_token;
   start_token.next();
$ cat ATTIC/67372a.groff
.ds v did
\A\*vs
$ ./build/test-groff -aww ATTIC/67372a.groff
troff:ATTIC/67372a.groff:2: warning: identifier validation escape sequence
expected a delimiter, got an escape character
<beginning of page>
dids
$ ./build/test-groff -Caww ATTIC/67372a.groff
<beginning of page>
1s


If this looks acceptable to you, I'll need to fix up the handlers for at least
\b, \B, \o, \w, and \X similarly, I expect.

And of course this is good fodder for a new automated test.


    _______________________________________________________

Reply to this item at:

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

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

Attachment: signature.asc
Description: PGP signature

Reply via email to