gbranden pushed a commit to branch master
in repository groff.

commit c5f5aef03f9413b14b6071dea4c43f1844540792
Author: G. Branden Robinson <[email protected]>
AuthorDate: Tue Aug 20 08:41:00 2024 -0500

    src/roff/troff/node.cpp: Solve commented mystery.
    
    The answer to the XXX question posed is that a garbage character could
    appear anywhere inside a lengthy escape sequence parameter.
    
    $ printf '\\[`\001e]\n.pl 1v\n' | nroff
    troff:<standard input>:1: error: a leader character is not allowed in an 
escape sequence parameter
    e]
    
    Above, the leader lies between two valid characters.  Take it out and
    all is well.
    
    $ printf '\\[`e]\n.pl 1v\n' | nroff
    รจ
---
 src/roff/troff/node.cpp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index f7089defe..1a4520747 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -5040,7 +5040,6 @@ static node *make_glyph_node(charinfo *s, environment 
*env,
          const char *nm = s->nm.contents();
          // If the contents are empty, get_char_for_escape_parameter()
          // should already have thrown an error.
-         // XXX: Why are we here if the parse failed that early?
          if (nm[0] != '\0') {
            const char *backslash = (nm[1] == '\0') ? "\\" : "";
            warning(WARN_CHAR, "special character '%1%2' not defined",

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

Reply via email to