summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2013-09-15 18:26:39 +0000
committerschwarze <schwarze@openbsd.org>2013-09-15 18:26:39 +0000
commite2ef70f620974044e6030754a94b37ef550fc9b5 (patch)
tree4bf7e66f815d03dd36a7929527e4a25019e7498e
parentFor some mdoc(7) macros, it is (unfortunately) semantically significant (diff)
downloadwireguard-openbsd-e2ef70f620974044e6030754a94b37ef550fc9b5.tar.xz
wireguard-openbsd-e2ef70f620974044e6030754a94b37ef550fc9b5.zip
Block closing macros do not allocate a new node but finish an existing
one, so they miss the clearing of MDOC_NEWLINE in mdoc.c, node_alloc(). Consequently, MDOC_NEWLINE must be cleared before processing the next macro on the same line. This fixes horizontal spacing for input lines beginning like .Oc Ns ... Issue found by Franco Fichtner <franco at lastsummer dot de> while working on DragonFly mandoc integration.
-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 b869c6fa3fe..813517b12bf 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.78 2012/11/19 22:28:35 schwarze Exp $ */
+/* $Id: mdoc_macro.c,v 1.79 2013/09/15 18:26:39 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012 Ingo Schwarze <schwarze@openbsd.org>
@@ -788,6 +788,9 @@ blk_exp_close(MACRO_PROT_ARGS)
return(0);
flushed = 1;
}
+
+ mdoc->flags &= ~MDOC_NEWLINE;
+
if ( ! mdoc_macro(mdoc, ntok, line, lastarg, pos, buf))
return(0);
break;