From ca9bc03cff40f97d7cd61a8a1ad5f04878abee7a Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Wed, 13 Apr 2022 13:19:34 +0000 Subject: 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. --- regress/roff/esc/E1.out_ascii | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 regress/roff/esc/E1.out_ascii (limited to 'regress/roff/esc/E1.out_ascii') diff --git a/regress/roff/esc/E1.out_ascii b/regress/roff/esc/E1.out_ascii new file mode 100644 index 00000000..1c4dbe14 --- /dev/null +++ b/regress/roff/esc/E1.out_ascii @@ -0,0 +1,21 @@ +ESC-E(1) General Commands Manual ESC-E(1) + +NNAAMMEE + eesscc--EE - copy-mode escaping of backslashes + +DDEESSCCRRIIPPTTIIOONN + initial text + + string expansion: myval myval myval myval + + output device: ascii ascii ascii ascii + + numerical expression test: 1 0 1 0 + + register: 1 2 3 3 + + special character: <= >= << >> + + final text + +OpenBSD April 13, 2022 OpenBSD -- cgit v1.2.3-56-ge451