summaryrefslogtreecommitdiffstats
path: root/mdoc.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-03-12 15:55:11 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-03-12 15:55:11 +0000
commitdd35a6706a756677ff1c2734a6eb2fad8a6784fb (patch)
treed375e2db00e997a1b57edabdfeabcb581c94d6b1 /mdoc.c
parentcef86e599370c167a95de14673094692334f586e (diff)
downloadmandoc-dd35a6706a756677ff1c2734a6eb2fad8a6784fb.tar.gz
NetBSD '.[[:whitespace:]]*' properly handled.
mdoc.3 indicates compatibilities and bugs.
Diffstat (limited to 'mdoc.c')
-rw-r--r--mdoc.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/mdoc.c b/mdoc.c
index caee2dd6..72e63a1c 100644
--- a/mdoc.c
+++ b/mdoc.c
@@ -520,7 +520,19 @@ parsemacro(struct mdoc *m, int ln, char *buf)
int i, c;
char mac[5];
- /* Comments are quickly ignored. */
+ /* Comments and empties are quickly ignored. */
+
+ if (0 == buf[1])
+ return(1);
+
+ if (isspace((unsigned char)buf[1])) {
+ i = 2;
+ while (buf[i] && isspace((unsigned char)buf[i]))
+ i++;
+ if (0 == buf[i])
+ return(1);
+ return(mdoc_perr(m, ln, 1, "invalid syntax"));
+ }
if (buf[1] && '\\' == buf[1])
if (buf[2] && '\"' == buf[2])