CVSROOT: /cvs Module name: src Changes by: schwa...@cvs.openbsd.org 2022/04/13 07:11:33
Modified files: usr.bin/mandoc : mandoc.c roff.c regress/usr.bin/mandoc/roff/esc: Makefile Added files: regress/usr.bin/mandoc/roff/esc: E1.in E1.out_ascii Log message: 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 handly arbitrary numbers of 'E's correctly.