summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libmandoc.h2
-rw-r--r--read.c2
-rw-r--r--roff.c10
3 files changed, 8 insertions, 6 deletions
diff --git a/libmandoc.h b/libmandoc.h
index 9ede43c6..c3a71304 100644
--- a/libmandoc.h
+++ b/libmandoc.h
@@ -66,7 +66,7 @@ int man_addspan(struct man *, const struct tbl_span *);
int man_addeqn(struct man *, const struct eqn *);
void roff_free(struct roff *);
-struct roff *roff_alloc(enum mparset, struct mparse *);
+struct roff *roff_alloc(enum mparset, struct mparse *, int);
void roff_reset(struct roff *);
enum rofferr roff_parseln(struct roff *, int,
char **, size_t *, int, int *);
diff --git a/read.c b/read.c
index 0d4f265f..3ada7840 100644
--- a/read.c
+++ b/read.c
@@ -780,7 +780,7 @@ mparse_alloc(enum mparset inttype, enum mandoclevel wlevel,
curp->defos = defos;
curp->quick = quick;
- curp->roff = roff_alloc(inttype, curp);
+ curp->roff = roff_alloc(inttype, curp, curp->quick);
return(curp);
}
diff --git a/roff.c b/roff.c
index 93e57af8..355e5488 100644
--- a/roff.c
+++ b/roff.c
@@ -1,7 +1,7 @@
/* $Id$ */
/*
* Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2010, 2011, 2012, 2013 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -109,6 +109,7 @@ struct roffreg {
struct roff {
enum mparset parsetype; /* requested parse type */
struct mparse *parse; /* parse point */
+ int quick; /* skip standard macro deletion */
struct roffnode *last; /* leaf of stack */
enum roffrule rstack[RSTACK_MAX]; /* stack of !`ie' rules */
char control; /* control character */
@@ -468,7 +469,7 @@ roff_free(struct roff *r)
struct roff *
-roff_alloc(enum mparset type, struct mparse *parse)
+roff_alloc(enum mparset type, struct mparse *parse, int quick)
{
struct roff *r;
int i;
@@ -476,6 +477,7 @@ roff_alloc(enum mparset type, struct mparse *parse)
r = mandoc_calloc(1, sizeof(struct roff));
r->parsetype = type;
r->parse = parse;
+ r->quick = quick;
r->rstackpos = -1;
roffhash_init();
@@ -1497,7 +1499,7 @@ roff_Dd(ROFF_ARGS)
{
const char *const *cp;
- if (MPARSE_MDOC != r->parsetype)
+ if (0 == r->quick && MPARSE_MDOC != r->parsetype)
for (cp = __mdoc_reserved; *cp; cp++)
roff_setstr(r, *cp, NULL, 0);
@@ -1510,7 +1512,7 @@ roff_TH(ROFF_ARGS)
{
const char *const *cp;
- if (MPARSE_MDOC != r->parsetype)
+ if (0 == r->quick && MPARSE_MDOC != r->parsetype)
for (cp = __man_reserved; *cp; cp++)
roff_setstr(r, *cp, NULL, 0);