summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-11-20 00:31:28 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-11-20 00:31:28 +0000
commit3664908c4187e81511fd26657c043f9fada292f1 (patch)
treea8c68d4076d0ca68b92723641637ed97ceabaa91
parenta32978d2cad8df466fc1ad27d42e6aff9ce25c9b (diff)
downloadmandoc-3664908c4187e81511fd26657c043f9fada292f1.tar.gz
Fix two minibugs reported by Thomas Klausner <wiz at NetBSD>:
1. The first argument of .Fn is not supposed to be parsed. 2. The .Fn macro is not supposed to reopen its scope after punctuation.
-rw-r--r--mdoc_macro.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mdoc_macro.c b/mdoc_macro.c
index 16c99abb..acc9c68c 100644
--- a/mdoc_macro.c
+++ b/mdoc_macro.c
@@ -926,7 +926,8 @@ in_line(MACRO_PROT_ARGS)
break;
}
- ntok = ARGS_QWORD == ac ? MDOC_MAX : lookup(tok, p);
+ ntok = (ac == ARGS_QWORD || (tok == MDOC_Fn && !cnt)) ?
+ MDOC_MAX : lookup(tok, p);
/*
* In this case, we've located a submacro and must
@@ -991,6 +992,8 @@ in_line(MACRO_PROT_ARGS)
if (scope && ! rew_elem(mdoc, tok))
return(0);
scope = 0;
+ if (tok == MDOC_Fn)
+ mayopen = 0;
} else if (mayopen && !scope) {
if ( ! mdoc_elem_alloc(mdoc, line, ppos, tok, arg))
return(0);