From 3664908c4187e81511fd26657c043f9fada292f1 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Thu, 20 Nov 2014 00:31:28 +0000 Subject: Fix two minibugs reported by Thomas Klausner : 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. --- mdoc_macro.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); -- cgit