summaryrefslogtreecommitdiffstatshomepage
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
commit58ec1de730c493d7dac46e9e8c77b5551fcc8df3 (patch)
tree79d6c850e01d7ff19e4974b84adde4cc810fc836 /mdoc.c
parent9712ec552692f3361d7528344ffff29931c4831e (diff)
downloadmandoc-58ec1de730c493d7dac46e9e8c77b5551fcc8df3.tar.gz
mandoc-58ec1de730c493d7dac46e9e8c77b5551fcc8df3.tar.zst
mandoc-58ec1de730c493d7dac46e9e8c77b5551fcc8df3.zip
NetBSD '.[[:whitespace:]]*' properly handled.
mdoc.3 indicates compatibilities and bugs.
Diffstat (limited to 'mdoc.c')
-rw-r--r--mdoc.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/mdoc.c b/mdoc.c
index 9c25faaf..719434ae 100644
--- a/mdoc.c
+++ b/mdoc.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc.c,v 1.62 2009/03/12 02:57:36 kristaps Exp $ */
+/* $Id: mdoc.c,v 1.63 2009/03/12 15:55:11 kristaps Exp $ */
/*
* Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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])