source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* pod2mdoc: only capital ASCII letters A-Z introduce formatting codes
@ 2014-07-19  0:42 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2014-07-19  0:42 UTC (permalink / raw)
  To: source

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

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

only message in thread, other threads:[~2014-07-19  0:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-19  0:42 pod2mdoc: only capital ASCII letters A-Z introduce formatting codes 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).