diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2020-08-27 12:59:02 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2020-08-27 12:59:02 +0000 |
commit | 817c9ebe02e8e98d07a0081313a87c1996ef3246 (patch) | |
tree | 9b1bd364051a8f1a68a159daeb1b95ec6e9cb35f /roff.c | |
parent | 6f26336e1989358418dea0298b76c51b63066948 (diff) | |
download | mandoc-817c9ebe02e8e98d07a0081313a87c1996ef3246.tar.gz |
Avoid artifacts in the most common case of closing conditional blocks
when no arguments follow the closing brace, \}.
For example, the line "'br\}" contained in the pod2man(1) preamble
would throw a bogus "escaped character not allowed in a name" error.
This issue was originally reported by Chris Bennett on ports@,
and afresh1@ noticed it came from the pod2man(1) preamble.
Diffstat (limited to 'roff.c')
-rw-r--r-- | roff.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -2362,7 +2362,9 @@ roff_cond_checkend(ROFF_ARGS) while ((ep = strchr(ep, '\\')) != NULL) { switch (ep[1]) { case '}': - if (rr) + if (ep[2] == '\0') + ep[0] = '\0'; + else if (rr) ep[1] = '&'; else memmove(ep, ep + 2, strlen(ep + 2) + 1); |