[BACK]Return to E1.in CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc / regress / roff / esc

File: [cvsweb.bsd.lv] / mandoc / regress / roff / esc / E1.in (download)

Revision 1.1, Wed Apr 13 13:19:36 2022 UTC (2 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: HEAD

Surprisingly, groff supports multiple copy mode escapes at the
beginning of an escape sequence: \, \E, \EE, \EEE, and so on all do
the same outside copy mode, so let them do the same in mandoc(1), too.

This fixes an assertion failure triggered by \EE*X that tb@ found
with afl(1).  The first E was consumed by roff_expand(), but that
function failed to recognize the escape sequence as the expansion
of a user-defined string and handed it over to mandoc_escape(),
which consumed the second E and then died on an assertion because
it is not prepared to handle user-defined strings.  Fix this by
letting *both* functions handle arbitrary numbers of 'E's correctly.

.\" $OpenBSD: E1.in,v 1.1 2022/04/13 13:11:33 schwarze Exp $
.Dd $Mdocdate: April 13 2022 $
.Dt ESC-E 1
.Os
.Sh NAME
.Nm esc-E
.Nd copy-mode escaping of backslashes
.Sh DESCRIPTION
.ds myvar myval
.nr myreg 1 1
initial text
.Pp
string expansion: \*[myvar] \E*[myvar] \EE*[myvar] \EEE*[myvar]
.Pp
output device: \*(.T \E*[.T] \EE*(.T \EEE*(.T
.Pp
numerical expression test: \B'1' \EB'X' \EEB'2' \EEEB'Y'
.Pp
register:
\n[myreg]
\En+[myreg]
\EEn+[myreg]
\EEEn[myreg]
.Pp
special character: \(<= \E(>= \EE(<< \EEE(>>
.Pp
final text