aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/man_macro.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-08-21 13:14:07 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-08-21 13:14:07 +0000
commit99a6b3d8600cc900aab0758eb53c7c73622876f2 (patch)
tree91b91b6522700934aebc799a44553fb366df6b49 /man_macro.c
parent133b6ec86f5c1723d06abd3b096c24406be4cea6 (diff)
downloadmandoc-99a6b3d8600cc900aab0758eb53c7c73622876f2.tar.gz
mandoc-99a6b3d8600cc900aab0758eb53c7c73622876f2.tar.zst
mandoc-99a6b3d8600cc900aab0758eb53c7c73622876f2.zip
Fixed next-line scoping of `.HP nnn' (has both next-line and on-line in head).
Diffstat (limited to 'man_macro.c')
-rw-r--r--man_macro.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/man_macro.c b/man_macro.c
index 867e3e70..bc2e8886 100644
--- a/man_macro.c
+++ b/man_macro.c
@@ -1,4 +1,4 @@
-/* $Id: man_macro.c,v 1.26 2009/08/21 12:12:12 kristaps Exp $ */
+/* $Id: man_macro.c,v 1.27 2009/08/21 13:14:07 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -40,7 +40,7 @@ const struct man_macro __man_macros[MAN_MAX] = {
{ in_line_eoln, 0 }, /* TH */
{ blk_imp, MAN_SCOPED }, /* SH */
{ blk_imp, MAN_SCOPED }, /* SS */
- { blk_imp, MAN_SCOPED }, /* TP */
+ { blk_imp, MAN_SCOPED | MAN_FSCOPED }, /* TP */
{ blk_imp, 0 }, /* LP */
{ blk_imp, 0 }, /* PP */
{ blk_imp, 0 }, /* P */
@@ -271,10 +271,18 @@ blk_imp(MACRO_PROT_ARGS)
/* Close out head and open body (unless MAN_SCOPE). */
- if (n == m->last && MAN_SCOPED & man_macros[tok].flags) {
- m->flags |= MAN_BLINE;
- return(1);
- } else if ( ! rew_scope(MAN_HEAD, m, tok))
+ if (MAN_SCOPED & man_macros[tok].flags) {
+ /* If we're forcing scope (`TP'), keep it open. */
+ if (MAN_FSCOPED & man_macros[tok].flags) {
+ m->flags |= MAN_BLINE;
+ return(1);
+ } else if (n == m->last) {
+ m->flags |= MAN_BLINE;
+ return(1);
+ }
+ }
+
+ if ( ! rew_scope(MAN_HEAD, m, tok))
return(0);
return(man_body_alloc(m, line, ppos, tok));