]> git.cameronkatri.com Git - mandoc.git/commit
Surprisingly, groff supports multiple copy mode escapes at the
authorIngo Schwarze <schwarze@openbsd.org>
Wed, 13 Apr 2022 13:19:34 +0000 (13:19 +0000)
committerIngo Schwarze <schwarze@openbsd.org>
Wed, 13 Apr 2022 13:19:34 +0000 (13:19 +0000)
commitca9bc03cff40f97d7cd61a8a1ad5f04878abee7a
tree26610d2bdaaa6010c584a31ecdea9305ababb927
parentef4cc03dbb7deeb4329a74e97c09433301435a54
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.
mandoc.c
regress/roff/esc/E1.in [new file with mode: 0644]
regress/roff/esc/E1.out_ascii [new file with mode: 0644]
regress/roff/esc/Makefile
roff.c