CVSROOT:        /cvs
Module name:    src
Changes by:     [email protected]        2026/10/07 10:26:15

Modified files:
        usr.bin/mandoc : roff_escape.c 

Log message:
Fix handling of special character escape sequences
used as escape sequence argument delimiters.

When a first inner escape sequence is used as the opening delimiter
of the argument of an outer escape sequence, the code parses the
argument looking for a second inner escape sequence.  If the
characters after the escape character of the first and second
matched, the code treated the second as the closing delimiter.
That resulted in prematurely ending the argument if the first
and second referred to different special characters.

Instead, if the first is a special character, only treat the second
as the closing delimiter if the first and second are completely
equal.  Otherwise, threat the second as part of the argument and
keep parsing the argument for a matching delimiter.

For escape sequence argument delimiters that are not special
characters, nothing changes: non-character escapes continue to match
in a delimiter role as long as their name characters match, even
if their arguments differ.

Reply via email to