summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2013-11-11 00:37:55 +0000
committerIngo Schwarze <schwarze@openbsd.org>2013-11-11 00:37:55 +0000
commitd6723f74a684ee974e1b51a37f806d2af1fcaaa7 (patch)
tree56f84116fe30fbeb2a8f53ea598a811b09452f85
parentb62bcd63e382e3538d704cd43ecca19bbf9c568b (diff)
downloadmandoc-d6723f74a684ee974e1b51a37f806d2af1fcaaa7.tar.gz
In the parser, when closing an explicit block that is not open,
close below-subsection implicit scopes that may still be open. In the formatter, make sure indentation is reset when leaving a scope, not only when entering the next one. Improves the formatting of gpg(1); issue reported by jca on ports.
-rw-r--r--man_macro.c10
-rw-r--r--man_term.c2
2 files changed, 8 insertions, 4 deletions
diff --git a/man_macro.c b/man_macro.c
index 18eedbcb..64597269 100644
--- a/man_macro.c
+++ b/man_macro.c
@@ -1,7 +1,7 @@
/* $Id$ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2012 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2012, 2013 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
@@ -298,10 +298,12 @@ blk_close(MACRO_PROT_ARGS)
if (ntok == nn->tok && MAN_BLOCK == nn->type)
break;
- if (NULL != nn)
- man_unscope(man, nn, MANDOCERR_MAX);
- else
+ if (NULL == nn) {
man_pmsg(man, line, ppos, MANDOCERR_NOSCOPE);
+ if ( ! rew_scope(MAN_BLOCK, man, MAN_PP))
+ return(0);
+ } else
+ man_unscope(man, nn, MANDOCERR_MAX);
return(1);
}
diff --git a/man_term.c b/man_term.c
index d02d3729..3c76f4cb 100644
--- a/man_term.c
+++ b/man_term.c
@@ -679,6 +679,7 @@ post_IP(DECL_ARGS)
break;
case (MAN_BODY):
term_newln(p);
+ p->offset = mt->offset;
break;
default:
break;
@@ -766,6 +767,7 @@ post_TP(DECL_ARGS)
break;
case (MAN_BODY):
term_newln(p);
+ p->offset = mt->offset;
break;
default:
break;