diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2014-09-06 23:24:28 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2014-09-06 23:24:28 +0000 |
commit | e9b079495988ca64ee62f873dbb5bee4c76d4a82 (patch) | |
tree | b277ac91b05eadebb1eba4d914c1c672444b7ba1 /usr.bin/mandoc/roff.c | |
parent | 6c344478d0311768775c38df1871d5c8c4e32924 (diff) |
Simplify by handling empty request lines at the one logical place
in the roff parser instead of in three other places in other parsers.
No functional change.
Diffstat (limited to 'usr.bin/mandoc/roff.c')
-rw-r--r-- | usr.bin/mandoc/roff.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.bin/mandoc/roff.c b/usr.bin/mandoc/roff.c index 88b9e2d7abe..84ce3a0ee89 100644 --- a/usr.bin/mandoc/roff.c +++ b/usr.bin/mandoc/roff.c @@ -1,4 +1,4 @@ -/* $OpenBSD: roff.c,v 1.99 2014/09/06 22:38:35 schwarze Exp $ */ +/* $OpenBSD: roff.c,v 1.100 2014/09/06 23:24:27 schwarze Exp $ */ /* * Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org> @@ -757,6 +757,15 @@ roff_parseln(struct roff *r, int ln, char **bufp, return(roff_parsetext(bufp, szp, pos, offs)); } + /* Skip empty request lines. */ + + if ((*bufp)[pos] == '"') { + mandoc_msg(MANDOCERR_COMMENT_BAD, r->parse, + ln, pos, NULL); + return(ROFF_IGN); + } else if ((*bufp)[pos] == '\0') + return(ROFF_IGN); + /* * If a scope is open, go to the child handler for that macro, * as it may want to preprocess before doing anything with it. |