aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_macro.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2012-07-18 16:20:43 +0000
committerIngo Schwarze <schwarze@openbsd.org>2012-07-18 16:20:43 +0000
commit544b05c948ba16b507a15686221cff4d6ab9393a (patch)
treea9e938e723468837ee4de909b2b6c77eccb05eb8 /mdoc_macro.c
parent50e01545158506c75fea9e1828a29ae1b8c911f0 (diff)
downloadmandoc-544b05c948ba16b507a15686221cff4d6ab9393a.tar.gz
mandoc-544b05c948ba16b507a15686221cff4d6ab9393a.tar.zst
mandoc-544b05c948ba16b507a15686221cff4d6ab9393a.zip
Let a trailing .Ns macro take effect
even on an input line containing a partial implicit macro. Fixes horizontal spacing in vi(1), ddb(4), and ppp(8). OpenBSD rev. 1.74.
Diffstat (limited to 'mdoc_macro.c')
-rw-r--r--mdoc_macro.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/mdoc_macro.c b/mdoc_macro.c
index 0e7c9bdb..eb7c78aa 100644
--- a/mdoc_macro.c
+++ b/mdoc_macro.c
@@ -1,7 +1,7 @@
-/* $Id: mdoc_macro.c,v 1.116 2012/05/27 17:39:28 schwarze Exp $ */
+/* $Id: mdoc_macro.c,v 1.117 2012/07/18 16:20:43 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2010, 2012 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -1359,6 +1359,13 @@ blk_part_imp(MACRO_PROT_ARGS)
if (n && ! rew_sub(MDOC_BLOCK, m, tok, line, ppos))
return(0);
+ /* Move trailing .Ns out of scope. */
+
+ for (n = body->child; n && n->next; n = n->next)
+ /* Do nothing. */ ;
+ if (n && MDOC_Ns == n->tok)
+ mdoc_node_relink(m, n);
+
return(1);
}