=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mdoc_macro.c,v retrieving revision 1.53 retrieving revision 1.54 diff -c -r1.53 -r1.54 *** src/usr.bin/mandoc/mdoc_macro.c 2010/07/01 22:31:52 1.53 --- src/usr.bin/mandoc/mdoc_macro.c 2010/07/13 01:09:13 1.54 *************** *** 1,6 **** ! /* $Id: mdoc_macro.c,v 1.53 2010/07/01 22:31:52 schwarze Exp $ */ /* ! * Copyright (c) 2008, 2009 Kristaps Dzonsons * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above --- 1,7 ---- ! /* $Id: mdoc_macro.c,v 1.54 2010/07/13 01:09:13 schwarze Exp $ */ /* ! * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons ! * Copyright (c) 2010 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above *************** *** 30,36 **** REWIND_THIS, REWIND_MORE, REWIND_LATER, ! REWIND_ERROR, }; static int blk_full(MACRO_PROT_ARGS); --- 31,37 ---- REWIND_THIS, REWIND_MORE, REWIND_LATER, ! REWIND_ERROR }; static int blk_full(MACRO_PROT_ARGS); *************** *** 410,416 **** * In particular, always skip block end markers, * and let all blocks rewind Nm children. */ ! if (p->end || MDOC_Nm == p->tok || (MDOC_BLOCK == p->type && ! (MDOC_EXPLICIT & mdoc_macros[tok].flags))) return(REWIND_MORE); --- 411,417 ---- * In particular, always skip block end markers, * and let all blocks rewind Nm children. */ ! if (ENDBODY_NOT != p->end || MDOC_Nm == p->tok || (MDOC_BLOCK == p->type && ! (MDOC_EXPLICIT & mdoc_macros[tok].flags))) return(REWIND_MORE); *************** *** 566,571 **** --- 567,573 ---- ! mdoc_body_alloc(m, n->line, n->pos, n->tok)) return(0); } + return(1); } *************** *** 650,656 **** /* Remember the start of our own body. */ if (MDOC_BODY == n->type && atok == n->tok) { ! if ( ! n->end) body = n; continue; } --- 652,658 ---- /* Remember the start of our own body. */ if (MDOC_BODY == n->type && atok == n->tok) { ! if (ENDBODY_NOT == n->end) body = n; continue; } *************** *** 1146,1151 **** --- 1148,1154 ---- return(1); } } + /* Close out scopes to remain in a consistent state. */ if ( ! rew_sub(MDOC_HEAD, m, tok, line, ppos))