=================================================================== RCS file: /cvs/mandoc/Attic/macro.c,v retrieving revision 1.45 retrieving revision 1.47 diff -u -p -r1.45 -r1.47 --- mandoc/Attic/macro.c 2009/01/20 13:05:28 1.45 +++ mandoc/Attic/macro.c 2009/01/20 16:04:48 1.47 @@ -1,4 +1,4 @@ -/* $Id: macro.c,v 1.45 2009/01/20 13:05:28 kristaps Exp $ */ +/* $Id: macro.c,v 1.47 2009/01/20 16:04:48 kristaps Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons * @@ -713,6 +713,8 @@ macro_scoped(MACRO_PROT_ARGS) assert ( ! (MDOC_CALLABLE & mdoc_macros[tok].flags)); + /* First rewind extant implicit scope. */ + if ( ! (MDOC_EXPLICIT & mdoc_macros[tok].flags)) { if ( ! rewind_subblock(MDOC_BODY, mdoc, tok, line, ppos)) return(0); @@ -720,6 +722,8 @@ macro_scoped(MACRO_PROT_ARGS) return(0); } + /* Parse arguments. */ + for (argc = 0; argc < MDOC_LINEARG_MAX; argc++) { lastarg = *pos; c = mdoc_argv(mdoc, line, tok, &argv[argc], pos, buf); @@ -1213,8 +1217,7 @@ macro_end(struct mdoc *mdoc) continue; if ( ! (MDOC_EXPLICIT & mdoc_macros[n->tok].flags)) continue; - mdoc_nerr(mdoc, n, "macro scope still open on exit"); - return(0); + return(mdoc_nerr(mdoc, n, "macro scope still open on exit")); } return(rewind_last(mdoc, mdoc->first));