From 2745b3f22e169e51509c6a77a688756f59a2b2b9 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sat, 6 Sep 2014 23:24:32 +0000 Subject: 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. --- roff.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'roff.c') 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 * Copyright (c) 2010-2014 Ingo Schwarze @@ -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. -- cgit v1.2.3-56-ge451