=================================================================== RCS file: /cvs/pod2mdoc/pod2mdoc.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -p -r1.33 -r1.34 --- pod2mdoc/pod2mdoc.c 2014/07/18 23:56:57 1.33 +++ pod2mdoc/pod2mdoc.c 2014/07/19 00:42:22 1.34 @@ -1,4 +1,4 @@ -/* $Id: pod2mdoc.c,v 1.33 2014/07/18 23:56:57 schwarze Exp $ */ +/* $Id: pod2mdoc.c,v 1.34 2014/07/19 00:42:22 schwarze Exp $ */ /* * Copyright (c) 2014 Kristaps Dzonsons * @@ -666,7 +666,8 @@ formatcode(struct state *st, const char *buf, size_t * 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 char *linemac, } 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 *buf, size_t sta * 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 *buf, size_t sta 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 *buf, size_t sta */ if ( ! st->wantws && start < end && - '<' != buf[start + 1]) { + ('<' != buf[start + 1] || + 'A' > buf[start] || + 'Z' < buf[start])) { printf(" Ns "); st->wantws = 1; }