aboutsummaryrefslogtreecommitdiffstatshomepage
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
commit6c87454429f536b827ffbc372f93ae495cb001d1 (patch)
tree0141035e3a0af1c668fb3733d65dc743a4e39763
parent2a40e9cd75077d3621f7f425661de140f506c850 (diff)
downloadmandoc-6c87454429f536b827ffbc372f93ae495cb001d1.tar.gz
mandoc-6c87454429f536b827ffbc372f93ae495cb001d1.tar.zst
mandoc-6c87454429f536b827ffbc372f93ae495cb001d1.zip
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.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/mdoc_macro.c b/mdoc_macro.c
index 5939833f..d4339670 100644
--- a/mdoc_macro.c
+++ b/mdoc_macro.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_macro.c,v 1.144 2014/11/17 06:44:58 schwarze Exp $ */
+/* $Id: mdoc_macro.c,v 1.145 2014/11/20 00:31:28 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -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);