=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/man.c,v retrieving revision 1.128 retrieving revision 1.129 diff -c -r1.128 -r1.129 *** src/usr.bin/mandoc/man.c 2018/08/26 16:18:38 1.128 --- src/usr.bin/mandoc/man.c 2018/12/14 05:17:45 1.129 *************** *** 1,4 **** ! /* $OpenBSD: man.c,v 1.128 2018/08/26 16:18:38 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2013,2014,2015,2017,2018 Ingo Schwarze --- 1,4 ---- ! /* $OpenBSD: man.c,v 1.129 2018/12/14 05:17:45 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2013,2014,2015,2017,2018 Ingo Schwarze *************** *** 120,127 **** if (buf[i] == '\0') { if (man->flags & (MAN_ELINE | MAN_BLINE)) { ! mandoc_msg(MANDOCERR_BLK_BLANK, man->parse, ! line, 0, NULL); return 1; } if (man->last->tok == MAN_SH || man->last->tok == MAN_SS) --- 120,126 ---- if (buf[i] == '\0') { if (man->flags & (MAN_ELINE | MAN_BLINE)) { ! mandoc_msg(MANDOCERR_BLK_BLANK, line, 0, NULL); return 1; } if (man->last->tok == MAN_SH || man->last->tok == MAN_SS) *************** *** 146,153 **** if (' ' == buf[i - 1] || '\t' == buf[i - 1]) { if (i > 1 && '\\' != buf[i - 2]) ! mandoc_msg(MANDOCERR_SPACE_EOL, man->parse, ! line, i - 1, NULL); for (--i; i && ' ' == buf[i]; i--) /* Spin back to non-space. */ ; --- 145,151 ---- if (' ' == buf[i - 1] || '\t' == buf[i - 1]) { if (i > 1 && '\\' != buf[i - 2]) ! mandoc_msg(MANDOCERR_SPACE_EOL, line, i - 1, NULL); for (--i; i && ' ' == buf[i]; i--) /* Spin back to non-space. */ ; *************** *** 192,199 **** if (sz > 0 && sz < 4) tok = roffhash_find(man->manmac, buf + ppos, sz); if (tok == TOKEN_NONE) { ! mandoc_msg(MANDOCERR_MACRO, man->parse, ! ln, ppos, buf + ppos - 1); return 1; } --- 190,196 ---- if (sz > 0 && sz < 4) tok = roffhash_find(man->manmac, buf + ppos, sz); if (tok == TOKEN_NONE) { ! mandoc_msg(MANDOCERR_MACRO, ln, ppos, "%s", buf + ppos - 1); return 1; } *************** *** 223,230 **** */ if (buf[offs] == '\0' && buf[offs - 1] == ' ') ! mandoc_msg(MANDOCERR_SPACE_EOL, man->parse, ! ln, offs - 1, NULL); /* * Some macros break next-line scopes; otherwise, remember --- 220,226 ---- */ if (buf[offs] == '\0' && buf[offs - 1] == ' ') ! mandoc_msg(MANDOCERR_SPACE_EOL, ln, offs - 1, NULL); /* * Some macros break next-line scopes; otherwise, remember *************** *** 297,305 **** == MAN_NSCOPED) n = n->parent; ! mandoc_vmsg(MANDOCERR_BLK_LINE, man->parse, ! n->line, n->pos, "%s breaks %s", ! roff_name[tok], roff_name[n->tok]); roff_node_delete(man, n); man->flags &= ~MAN_ELINE; --- 293,300 ---- == MAN_NSCOPED) n = n->parent; ! mandoc_msg(MANDOCERR_BLK_LINE, n->line, n->pos, ! "%s breaks %s", roff_name[tok], roff_name[n->tok]); roff_node_delete(man, n); man->flags &= ~MAN_ELINE; *************** *** 339,347 **** assert(n->type == ROFFT_BLOCK); assert(man_macro(n->tok)->flags & MAN_BSCOPED); ! mandoc_vmsg(MANDOCERR_BLK_LINE, man->parse, ! n->line, n->pos, "%s breaks %s", ! roff_name[tok], roff_name[n->tok]); roff_node_delete(man, n); man->flags &= ~MAN_BLINE; --- 334,341 ---- assert(n->type == ROFFT_BLOCK); assert(man_macro(n->tok)->flags & MAN_BSCOPED); ! mandoc_msg(MANDOCERR_BLK_LINE, n->line, n->pos, ! "%s breaks %s", roff_name[tok], roff_name[n->tok]); roff_node_delete(man, n); man->flags &= ~MAN_BLINE; *************** *** 356,371 **** case MAN_nf: case MAN_EX: if (man->flags & MAN_LITERAL && ! (n->flags & NODE_VALID)) ! mandoc_msg(MANDOCERR_NF_SKIP, man->parse, ! n->line, n->pos, "nf"); man->flags |= MAN_LITERAL; break; case MAN_fi: case MAN_EE: if ( ! (man->flags & MAN_LITERAL) && ! (n->flags & NODE_VALID)) ! mandoc_msg(MANDOCERR_FI_SKIP, man->parse, ! n->line, n->pos, "fi"); man->flags &= ~MAN_LITERAL; break; default: --- 350,363 ---- case MAN_nf: case MAN_EX: if (man->flags & MAN_LITERAL && ! (n->flags & NODE_VALID)) ! mandoc_msg(MANDOCERR_NF_SKIP, n->line, n->pos, "nf"); man->flags |= MAN_LITERAL; break; case MAN_fi: case MAN_EE: if ( ! (man->flags & MAN_LITERAL) && ! (n->flags & NODE_VALID)) ! mandoc_msg(MANDOCERR_FI_SKIP, n->line, n->pos, "fi"); man->flags &= ~MAN_LITERAL; break; default: