source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: schwarze@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: pod2mdoc: only capital ASCII letters A-Z introduce formatting codes
Date: Fri, 18 Jul 2014 20:42:24 -0400 (EDT)	[thread overview]
Message-ID: <201407190042.s6J0gO76030500@krisdoz.my.domain> (raw)

Log Message:
-----------
only capital ASCII letters A-Z introduce formatting codes

Modified Files:
--------------
    pod2mdoc:
        pod2mdoc.c
    pod2mdoc/Regress/formatcode:
        invalid.pod

Revision Data
-------------
Index: pod2mdoc.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/pod2mdoc/pod2mdoc.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -Lpod2mdoc.c -Lpod2mdoc.c -u -p -r1.33 -r1.34
--- pod2mdoc.c
+++ pod2mdoc.c
@@ -666,7 +666,8 @@ formatcode(struct state *st, const char 
 				break;
 			}
 		}
-		if (*start + 1 < end && '<' == buf[*start + 1]) {
+		if (*start + 1 < end && '<' == buf[*start + 1] &&
+		    'A' <= buf[*start] && 'Z' >= buf[*start]) {
 			formatcode(st, buf, start, end, nomacro, 1);
 			continue;
 		}
@@ -746,7 +747,8 @@ formatcodeln(struct state *st, const cha
 			} while (*start < end && ' ' == buf[*start]);
 		}
 
-		if (*start + 1 < end && '<' == buf[*start + 1]) {
+		if (*start + 1 < end && '<' == buf[*start + 1] &&
+		    'A' <= buf[*start] && 'Z' >= buf[*start]) {
 			st->wantws |= wantws;
 			gotmacro = formatcode(st, buf,
 			    start, end, nomacro, 1);
@@ -1220,7 +1222,8 @@ ordinary(struct state *st, const char *b
 		 * Escape initial control characters.
 		 */
 		while (start < end) {
-			if (start < end - 1 && '<' == buf[start + 1])
+			if (start < end - 1 && '<' == buf[start + 1] &&
+			    'A' <= buf[start] && 'Z' >= buf[start])
 				break;
 			else if ('\n' == buf[start])
 				break;
@@ -1256,7 +1259,8 @@ ordinary(struct state *st, const char *b
 				outbuf_addchar(st);
 		}
 
-		if (start < end - 1 && '<' == buf[start + 1]) {
+		if (start < end - 1 && '<' == buf[start + 1] &&
+		    'A' <= buf[start] && 'Z' >= buf[start]) {
 			formatcode(st, buf, &start, end, 0, seq);
 			if (OUST_MAC == st->oust) {
 				/*
@@ -1294,7 +1298,9 @@ ordinary(struct state *st, const char *b
 				 */
 
 				if ( ! st->wantws && start < end &&
-				    '<' != buf[start + 1]) {
+				    ('<' != buf[start + 1] ||
+				     'A' > buf[start] ||
+				     'Z' < buf[start])) {
 					printf(" Ns ");
 					st->wantws = 1;
 				}
Index: invalid.pod
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/pod2mdoc/Regress/formatcode/invalid.pod,v
retrieving revision 1.2
retrieving revision 1.3
diff -LRegress/formatcode/invalid.pod -LRegress/formatcode/invalid.pod -u -p -r1.2 -r1.3
--- Regress/formatcode/invalid.pod
+++ Regress/formatcode/invalid.pod
@@ -6,8 +6,16 @@ invalid - invalid escape sequence
 
 beforeY<invalid>after
 
+before=<invalid>after
+
 before B<inY<val>id> after
 
+before B<in=<val>id> after
+
 =head3 containsY<invalid>sequence
+
+plain text
+
+=head3 contains=<invalid>sequence
 
 plain text
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

                 reply	other threads:[~2014-07-19  0:42 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=201407190042.s6J0gO76030500@krisdoz.my.domain \
    --to=schwarze@mdocml.bsd.lv \
    --cc=source@mdocml.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).