summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/mdoc_macro.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2010-07-01 21:08:50 +0000
committerschwarze <schwarze@openbsd.org>2010-07-01 21:08:50 +0000
commit3ba23be585319747d578cdf06675aaeb1cfde38a (patch)
tree843b918ec3a974e8c8c6027562fcde9ef0a512ee /usr.bin/mandoc/mdoc_macro.c
parentsort SEE ALSO; (diff)
downloadwireguard-openbsd-3ba23be585319747d578cdf06675aaeb1cfde38a.tar.xz
wireguard-openbsd-3ba23be585319747d578cdf06675aaeb1cfde38a.zip
Correct handling of trailing punctuation in MDOC_DELIM blk_full HEADs.
The bug was uncovered by SYNOPSIS .Nm as this happened to be the first block with this particular combination of properties. Found the hard way by kristaps@ in NetBSD gcc-contrib(1), fix by me.
Diffstat (limited to 'usr.bin/mandoc/mdoc_macro.c')
-rw-r--r--usr.bin/mandoc/mdoc_macro.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/mandoc/mdoc_macro.c b/usr.bin/mandoc/mdoc_macro.c
index e14f6ac00a1..e69a94b46d9 100644
--- a/usr.bin/mandoc/mdoc_macro.c
+++ b/usr.bin/mandoc/mdoc_macro.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_macro.c,v 1.51 2010/07/01 15:36:59 schwarze Exp $ */
+/* $Id: mdoc_macro.c,v 1.52 2010/07/01 21:08:50 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -1020,6 +1020,9 @@ blk_full(MACRO_PROT_ARGS)
lac = ARGS_ERROR == ac ? ARGS_PEND : ac;
ac = mdoc_args(m, line, pos, buf, tok, &p);
+ if (ARGS_PUNCT == ac)
+ break;
+
if (ARGS_ERROR == ac)
return(0);