aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/man_macro.c
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
commit399942b9c89420955d4228916334e0a5d499da86 (patch)
treef32738f694568451bbfec2db5d1bb0db67842010 /man_macro.c
parent7e66e0356807e7c8c64b707c229784ae9fdc0512 (diff)
downloadmandoc-399942b9c89420955d4228916334e0a5d499da86.tar.gz
mandoc-399942b9c89420955d4228916334e0a5d499da86.tar.zst
mandoc-399942b9c89420955d4228916334e0a5d499da86.zip
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.
Diffstat (limited to 'man_macro.c')
-rw-r--r--man_macro.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/man_macro.c b/man_macro.c
index eaa8fba0..0078f479 100644
--- a/man_macro.c
+++ b/man_macro.c
@@ -1,7 +1,7 @@
-/* $Id: man_macro.c,v 1.76 2013/10/17 20:54:58 schwarze Exp $ */
+/* $Id: man_macro.c,v 1.77 2013/11/11 00:37:55 schwarze Exp $ */
/*
* 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);
}