aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roff.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-09-06 23:24:32 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-09-06 23:24:32 +0000
commit2745b3f22e169e51509c6a77a688756f59a2b2b9 (patch)
tree23a8d2cac4465ef19f4105efe1a1fbe84a9ffd9d /roff.c
parent1e75b893a49c0cbdd978438e15c5a8fa8aebb510 (diff)
downloadmandoc-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.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/roff.c b/roff.c
index 1d8a3991..fac9ffa3 100644
--- a/roff.c
+++ b/roff.c
@@ -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.