source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mandoc: Avoid artifacts in the most common case of closing conditional
@ 2020-08-27 12:59 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2020-08-27 12:59 UTC (permalink / raw)
  To: source

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-08-27 12:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-27 12:59 mandoc: Avoid artifacts in the most common case of closing conditional schwarze

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).