summaryrefslogtreecommitdiffstats
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
commit29fda0e9758370f8c242409db0c06dc1d75972df (patch)
treee368129d4e2bf92c8c4b368fce8d8c95270115ec /roff.c
parentc525d64ed5cfcdc59ac04ab0411b657f2e5e157a (diff)
downloadmandoc-29fda0e9758370f8c242409db0c06dc1d75972df.tar.gz
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.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/roff.c b/roff.c
index 4d3b525b..406485ab 100644
--- a/roff.c
+++ b/roff.c
@@ -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.