summaryrefslogtreecommitdiffstats
path: root/mdoc_macro.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2012-01-02 15:48:05 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2012-01-02 15:48:05 +0000
commit9348152074166de86477812fc96c95f6333175ec (patch)
tree29e596013eed6a10064f982fa3e2b43122339749 /mdoc_macro.c
parent7bb629495becbeda3fd6ae7039b9083ce5824b88 (diff)
downloadmandoc-9348152074166de86477812fc96c95f6333175ec.tar.gz
`-diag' lists aren't parsed, unlike other list types. This fixes a TODO
entry raised by deraadt@.
Diffstat (limited to 'mdoc_macro.c')
-rw-r--r--mdoc_macro.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/mdoc_macro.c b/mdoc_macro.c
index 0400e3f2..add440b3 100644
--- a/mdoc_macro.c
+++ b/mdoc_macro.c
@@ -228,7 +228,6 @@ mdoc_macroend(struct mdoc *m)
static enum mdoct
lookup(enum mdoct from, const char *p)
{
- /* FIXME: make -diag lists be un-PARSED. */
if ( ! (MDOC_PARSED & mdoc_macros[from].flags))
return(MDOC_MAX);
@@ -984,7 +983,7 @@ in_line(MACRO_PROT_ARGS)
static int
blk_full(MACRO_PROT_ARGS)
{
- int la, nl;
+ int la, nl, nparsed;
struct mdoc_arg *arg;
struct mdoc_node *head; /* save of head macro */
struct mdoc_node *body; /* save of body macro */
@@ -995,6 +994,16 @@ blk_full(MACRO_PROT_ARGS)
enum margverr av;
char *p;
+ /*
+ * Exception: `-diag' lists are not parsed, but lists in general
+ * are parsed.
+ */
+ nparsed = 0;
+ if (MDOC_It == tok && NULL != m->last &&
+ MDOC_Bl == m->last->tok &&
+ LIST_diag == m->last->norm->Bl.type)
+ nparsed = 1;
+
nl = MDOC_NEWLINE & m->flags;
/* Close out prior implicit scope. */
@@ -1146,7 +1155,8 @@ blk_full(MACRO_PROT_ARGS)
continue;
}
- ntok = ARGS_QWORD == ac ? MDOC_MAX : lookup(tok, p);
+ ntok = nparsed || ARGS_QWORD == ac ?
+ MDOC_MAX : lookup(tok, p);
if (MDOC_MAX == ntok) {
if ( ! dword(m, line, la, p, DELIM_MAX))