summaryrefslogtreecommitdiffstats
path: root/read.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 /read.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 'read.c')
-rw-r--r--read.c19
1 files changed, 4 insertions, 15 deletions
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