summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--man.c7
-rw-r--r--mdoc.c9
-rw-r--r--read.c19
-rw-r--r--roff.c9
4 files changed, 13 insertions, 31 deletions
diff --git a/man.c b/man.c
index 89da5cb5..a233f01e 100644
--- a/man.c
+++ b/man.c
@@ -471,13 +471,6 @@ man_pmacro(struct man *man, int ln, char *buf, int offs)
int i, ppos;
int bline;
- if ('"' == buf[offs]) {
- mandoc_msg(MANDOCERR_COMMENT_BAD, man->parse,
- ln, offs, NULL);
- return(1);
- } else if ('\0' == buf[offs])
- return(1);
-
ppos = offs;
/*
diff --git a/mdoc.c b/mdoc.c
index ede6256b..4d4f504e 100644
--- a/mdoc.c
+++ b/mdoc.c
@@ -793,15 +793,6 @@ mdoc_pmacro(struct mdoc *mdoc, int ln, char *buf, int offs)
char mac[5];
struct mdoc_node *n;
- /* Empty post-control lines are ignored. */
-
- if ('"' == buf[offs]) {
- mandoc_msg(MANDOCERR_COMMENT_BAD, mdoc->parse,
- ln, offs, NULL);
- return(1);
- } else if ('\0' == buf[offs])
- return(1);
-
sv = offs;
/*
diff --git a/read.c b/read.c
index 70c6567f..931d82fa 100644
--- a/read.c
+++ b/read.c
@@ -69,9 +69,9 @@ struct mparse {
int line; /* line number in the file */
};
+static void choose_parser(struct mparse *);
static void resize_buf(struct buf *, size_t);
static void mparse_buf_r(struct mparse *, struct buf, int);
-static void pset(const char *, int, struct mparse *);
static int read_whole_file(struct mparse *, const char *, int,
struct buf *, int *);
static void mparse_end(struct mparse *);
@@ -247,19 +247,10 @@ resize_buf(struct buf *buf, size_t initial)
}
static void
-pset(const char *buf, int pos, struct mparse *curp)
+choose_parser(struct mparse *curp)
{
char *cp, *ep;
int format;
- int i;
-
- if ('.' == buf[0] || '\'' == buf[0]) {
- for (i = 1; buf[i]; i++)
- if (' ' != buf[i] && '\t' != buf[i])
- break;
- if ('\0' == buf[i])
- return;
- }
/*
* If neither command line arguments -mdoc or -man select
@@ -550,12 +541,10 @@ rerun:
*/
if ( ! (curp->man || curp->mdoc))
- pset(ln.buf + of, pos - of, curp);
+ choose_parser(curp);
/*
- * Lastly, push down into the parsers themselves. One
- * of these will have already been set in the pset()
- * routine.
+ * Lastly, push down into the parsers themselves.
* If libroff returns ROFF_TBL, then add it to the
* currently open parse. Since we only get here if
* there does exist data (see tbl_data.c), we're
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.