summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/mdoc.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2010-05-08 01:52:08 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2010-05-08 01:52:08 +0000
commit8e1ec00d78a028b557330f0ede1b9d4d43388bda (patch)
treeebe337982acfe638a3a2c77ed9b22add3b04feba /usr.bin/mandoc/mdoc.c
parent7d90ac7f43ce127c37d0aca2698efebff57302c2 (diff)
handle text lines beginning with \." as comments, like groff does,
even though this is not correct comment syntax (so warn, too) reported by Claus Assmann on misc@, fix by kristaps@
Diffstat (limited to 'usr.bin/mandoc/mdoc.c')
-rw-r--r--usr.bin/mandoc/mdoc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.bin/mandoc/mdoc.c b/usr.bin/mandoc/mdoc.c
index 374c3b81f4a..53de090517a 100644
--- a/usr.bin/mandoc/mdoc.c
+++ b/usr.bin/mandoc/mdoc.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc.c,v 1.43 2010/05/04 23:13:54 schwarze Exp $ */
+/* $Id: mdoc.c,v 1.44 2010/05/08 01:52:07 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -80,6 +80,7 @@ const char *const __mdoc_merrnames[MERRMAX] = {
"no description found for library", /* ELIB */
"bad child for parent context", /* EBADCHILD */
"list arguments preceding type", /* ENOTYPE */
+ "deprecated comment style", /* EBADCOMMENT */
};
const char *const __mdoc_macronames[MDOC_MAX] = {
@@ -630,6 +631,11 @@ parsetext(struct mdoc *m, int line, char *buf)
int i, j;
char sv;
+ /* Ignore bogus comments. */
+
+ if ('\\' == buf[0] && '.' == buf[1] && '\"' == buf[2])
+ return(mdoc_pwarn(m, line, 0, EBADCOMMENT));
+
if (SEC_NONE == m->lastnamed)
return(mdoc_perr(m, line, 0, ETEXTPROL));