From 7dd5c61d801d065c98fea61d76ccc782ac3de66f Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sun, 26 Sep 2010 20:22:28 +0000 Subject: If an explicit scope is still open at the end of an input file, report an ERROR: We can still render the page by just closing the open scope, but it is likely that information will be missing or document structure mangled. Before, man(7) only reported a WARNING (which is dangerous because we cannot be sure rendering is correct) and mdoc(7) ran into FATAL (which is too drastic, there is no reason not to show what we have). "looks good" kristaps@ --- mdoc_macro.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'mdoc_macro.c') diff --git a/mdoc_macro.c b/mdoc_macro.c index 91972f34..cd6d23a5 100644 --- a/mdoc_macro.c +++ b/mdoc_macro.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_macro.c,v 1.93 2010/07/18 17:00:26 schwarze Exp $ */ +/* $Id: mdoc_macro.c,v 1.94 2010/09/26 20:22:28 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * Copyright (c) 2010 Ingo Schwarze @@ -207,14 +207,10 @@ mdoc_macroend(struct mdoc *m) n = MDOC_VALID & m->last->flags ? m->last->parent : m->last; - for ( ; n; n = n->parent) { - if (MDOC_BLOCK != n->type) - continue; - if ( ! (MDOC_EXPLICIT & mdoc_macros[n->tok].flags)) - continue; - mdoc_nmsg(m, n, MANDOCERR_SYNTSCOPE); - return(0); - } + for ( ; n; n = n->parent) + if (MDOC_BLOCK == n->type && + MDOC_EXPLICIT & mdoc_macros[n->tok].flags) + mdoc_nmsg(m, n, MANDOCERR_SCOPEEXIT); /* Rewind to the first. */ -- cgit v1.2.3-56-ge451