diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-09-06 23:24:32 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-09-06 23:24:32 +0000 |
commit | 2745b3f22e169e51509c6a77a688756f59a2b2b9 (patch) | |
tree | 23a8d2cac4465ef19f4105efe1a1fbe84a9ffd9d /roff.c | |
parent | 1e75b893a49c0cbdd978438e15c5a8fa8aebb510 (diff) | |
download | mandoc-2745b3f22e169e51509c6a77a688756f59a2b2b9.tar.gz mandoc-2745b3f22e169e51509c6a77a688756f59a2b2b9.tar.zst mandoc-2745b3f22e169e51509c6a77a688756f59a2b2b9.zip |
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 'roff.c')
-rw-r--r-- | roff.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -1,4 +1,4 @@ -/* $Id: roff.c,v 1.227 2014/09/06 22:39:36 schwarze Exp $ */ +/* $Id: roff.c,v 1.228 2014/09/06 23:24:32 schwarze Exp $ */ /* * Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org> @@ -759,6 +759,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. |