help / color / mirror / Atom feed
Subject: mandoc: Allow arbitrary argument delimiters for \C, like groff does.
Date: Mon, 6 Jun 2022 07:10:18 -0500 (EST)	[thread overview]
Message-ID: <> (raw)

Log Message:
Allow arbitrary argument delimiters for \C, like groff does.
The restriction of only allowing ' as the delimiter was introduced
by kristaps@ on 2011/04/09 when he first supported \C.
For most other escape sequences, similar restrictions were relaxed
later on, but for the rarely used \C, it was apparently forgotten.

While here, reject empty character names: they are never valid.

Modified Files:

Revision Data
Index: roff_escape.c
RCS file: /home/cvs/mandoc/mandoc/roff_escape.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -Lroff_escape.c -Lroff_escape.c -u -p -r1.10 -r1.11
--- roff_escape.c
+++ roff_escape.c
@@ -206,10 +206,6 @@ roff_escape(const char *buf, const int l
 		term = '\b';
 	case 'C':
-		if (buf[iarg] != '\'') {
-			rval = ESCAPE_ERROR;
-			goto out;
-		}
 		term = '\b';
@@ -391,6 +387,11 @@ roff_escape(const char *buf, const int l
+		if (argl == 0) {
+			rval = ESCAPE_ERROR;
+			break;
+		}
 		 * The file chars.c only provides one common list of
 To unsubscribe send an email to

                 reply	other threads:[~2022-06-06 12:10 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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

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