From: schwarze@mandoc.bsd.lv
To: source@mandoc.bsd.lv
Subject: mandoc: Avoid artifacts in the most common case of closing conditional
Date: Thu, 27 Aug 2020 07:59:32 -0500 (EST) [thread overview]
Message-ID: <f200b25b55ab7e80@mandoc.bsd.lv> (raw)
Log Message:
-----------
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.
Modified Files:
--------------
mandoc:
roff.c
Revision Data
-------------
Index: roff.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/roff.c,v
retrieving revision 1.375
retrieving revision 1.376
diff -Lroff.c -Lroff.c -u -p -r1.375 -r1.376
--- roff.c
+++ roff.c
@@ -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);
--
To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv
reply other threads:[~2020-08-27 12:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f200b25b55ab7e80@mandoc.bsd.lv \
--to=schwarze@mandoc.bsd.lv \
--cc=source@mandoc.bsd.lv \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).