=================================================================== RCS file: /cvs/mandoc/mdoc_validate.c,v retrieving revision 1.221 retrieving revision 1.223 diff -u -p -r1.221 -r1.223 --- mandoc/mdoc_validate.c 2014/07/02 13:10:45 1.221 +++ mandoc/mdoc_validate.c 2014/07/02 20:19:11 1.223 @@ -1,4 +1,4 @@ -/* $Id: mdoc_validate.c,v 1.221 2014/07/02 13:10:45 schwarze Exp $ */ +/* $Id: mdoc_validate.c,v 1.223 2014/07/02 20:19:11 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2014 Ingo Schwarze @@ -1668,12 +1668,13 @@ ebool(struct mdoc *mdoc) { if (NULL == mdoc->last->child) { - mdoc_nmsg(mdoc, mdoc->last, MANDOCERR_MACROEMPTY); - mdoc_node_delete(mdoc, mdoc->last); + if (MDOC_Sm == mdoc->last->tok) + mdoc->flags ^= MDOC_SMOFF; return(1); } - check_count(mdoc, MDOC_ELEM, CHECK_WARN, CHECK_EQ, 1); + check_count(mdoc, MDOC_ELEM, CHECK_WARN, CHECK_LT, 2); + assert(MDOC_TEXT == mdoc->last->child->type); if (0 == strcmp(mdoc->last->child->string, "on")) { @@ -1728,7 +1729,9 @@ post_st(POST_ARGS) const char *p; if (NULL == (ch = mdoc->last->child)) { - mdoc_nmsg(mdoc, mdoc->last, MANDOCERR_MACROEMPTY); + mandoc_msg(MANDOCERR_MACRO_EMPTY, mdoc->parse, + mdoc->last->line, mdoc->last->pos, + mdoc_macronames[mdoc->last->tok]); mdoc_node_delete(mdoc, mdoc->last); return(1); }