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

source@mandoc.bsd.lv

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/mandoc-source

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 mandoc-source mandoc-source/ http://inbox.vuxu.org/mandoc-source \
		source@mandoc.bsd.lv
	public-inbox-index mandoc-source

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.mandoc.source


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git