diff options
author | 2010-05-08 01:52:07 +0000 | |
---|---|---|
committer | 2010-05-08 01:52:07 +0000 | |
commit | f0752e9420779c75cfe49cc3ee9cae9875cd99bf (patch) | |
tree | 151a90eb5a2e113b78710212fb73e182f245ba3a /usr.bin/mandoc/man.c | |
parent | sync to bsd.lv rev 1.12: (diff) | |
download | wireguard-openbsd-f0752e9420779c75cfe49cc3ee9cae9875cd99bf.tar.xz wireguard-openbsd-f0752e9420779c75cfe49cc3ee9cae9875cd99bf.zip |
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/man.c')
-rw-r--r-- | usr.bin/mandoc/man.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.bin/mandoc/man.c b/usr.bin/mandoc/man.c index 24a4c27cfe8..7592c7b0b80 100644 --- a/usr.bin/mandoc/man.c +++ b/usr.bin/mandoc/man.c @@ -1,4 +1,4 @@ -/* $Id: man.c,v 1.25 2010/04/25 16:32:19 schwarze Exp $ */ +/* $Id: man.c,v 1.26 2010/05/08 01:52:07 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -49,6 +49,7 @@ const char *const __man_merrnames[WERRMAX] = { "invalid nesting of roff declarations", /* WROFFNEST */ "scope in roff instructions broken", /* WROFFSCOPE */ "document title should be uppercase", /* WTITLECASE */ + "deprecated comment style", /* WBADCOMMENT */ }; const char *const __man_macronames[MAN_MAX] = { @@ -391,6 +392,11 @@ man_ptext(struct man *m, int line, char *buf) int i, j; char sv; + /* Ignore bogus comments. */ + + if ('\\' == buf[0] && '.' == buf[1] && '\"' == buf[2]) + return(man_pwarn(m, line, 0, WBADCOMMENT)); + /* Literal free-form text whitespace is preserved. */ if (MAN_LITERAL & m->flags) { |