summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/mdoc_macro.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2014-11-20 00:30:34 +0000
committerschwarze <schwarze@openbsd.org>2014-11-20 00:30:34 +0000
commitcf46e01297bfa177fab0996b6aaa905ad2e61ab8 (patch)
tree197f91aee8866877d78868a1a3f3ff978ffa2f51 /usr.bin/mandoc/mdoc_macro.c
parentmerge conflicts (diff)
downloadwireguard-openbsd-cf46e01297bfa177fab0996b6aaa905ad2e61ab8.tar.xz
wireguard-openbsd-cf46e01297bfa177fab0996b6aaa905ad2e61ab8.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.
Diffstat (limited to 'usr.bin/mandoc/mdoc_macro.c')
-rw-r--r--usr.bin/mandoc/mdoc_macro.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/mandoc/mdoc_macro.c b/usr.bin/mandoc/mdoc_macro.c
index 647ce0127de..6c584c54def 100644
--- a/usr.bin/mandoc/mdoc_macro.c
+++ b/usr.bin/mandoc/mdoc_macro.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mdoc_macro.c,v 1.100 2014/11/17 06:44:35 schwarze Exp $ */
+/* $OpenBSD: mdoc_macro.c,v 1.101 2014/11/20 00:30:34 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -924,7 +924,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
@@ -989,6 +990,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);