aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2013-09-15 18:26:46 +0000
committerIngo Schwarze <schwarze@openbsd.org>2013-09-15 18:26:46 +0000
commitbcae865b5f52b7036c73ea5e88895b9b7e8c6b1e (patch)
tree3e869173b1af0ec3bdf06ea94f2e085a5ea07b34
parentfb1d9a8f6663d8c5321def7ad5c3cdab2451d965 (diff)
downloadmandoc-bcae865b5f52b7036c73ea5e88895b9b7e8c6b1e.tar.gz
mandoc-bcae865b5f52b7036c73ea5e88895b9b7e8c6b1e.tar.zst
mandoc-bcae865b5f52b7036c73ea5e88895b9b7e8c6b1e.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--mdoc_macro.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mdoc_macro.c b/mdoc_macro.c
index 7e143e02..0a504864 100644
--- a/mdoc_macro.c
+++ b/mdoc_macro.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_macro.c,v 1.121 2012/11/19 22:30:58 schwarze Exp $ */
+/* $Id: mdoc_macro.c,v 1.122 2013/09/15 18:26:46 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012 Ingo Schwarze <schwarze@openbsd.org>
@@ -792,6 +792,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;