diff options
author | 2012-07-18 16:20:14 +0000 | |
---|---|---|
committer | 2012-07-18 16:20:14 +0000 | |
commit | ac5954a5388ddf9a83c1c0a8939ba6f107593c0f (patch) | |
tree | e1ae60f2eb073047d304a0c42861ed4dab21e21e /usr.bin/mandoc/mdoc_macro.c | |
parent | Print messages about nodes purged from the node cache if hostap/ibss modes are (diff) | |
download | wireguard-openbsd-ac5954a5388ddf9a83c1c0a8939ba6f107593c0f.tar.xz wireguard-openbsd-ac5954a5388ddf9a83c1c0a8939ba6f107593c0f.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).
Diffstat (limited to 'usr.bin/mandoc/mdoc_macro.c')
-rw-r--r-- | usr.bin/mandoc/mdoc_macro.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/usr.bin/mandoc/mdoc_macro.c b/usr.bin/mandoc/mdoc_macro.c index 1c96266df20..ea0af8c83d7 100644 --- a/usr.bin/mandoc/mdoc_macro.c +++ b/usr.bin/mandoc/mdoc_macro.c @@ -1,7 +1,7 @@ -/* $Id: mdoc_macro.c,v 1.73 2012/01/04 02:17:42 schwarze Exp $ */ +/* $Id: mdoc_macro.c,v 1.74 2012/07/18 16:20:14 schwarze Exp $ */ /* - * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> - * Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org> + * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> + * 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 @@ -1355,6 +1355,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); } |