=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/man_validate.c,v retrieving revision 1.127 retrieving revision 1.128 diff -u -r1.127 -r1.128 --- src/usr.bin/mandoc/man_validate.c 2022/08/02 11:55:51 1.127 +++ src/usr.bin/mandoc/man_validate.c 2023/04/28 20:14:19 1.128 @@ -1,4 +1,4 @@ -/* $OpenBSD: man_validate.c,v 1.127 2022/08/02 11:55:51 schwarze Exp $ */ +/* $OpenBSD: man_validate.c,v 1.128 2023/04/28 20:14:19 schwarze Exp $ */ /* * Copyright (c) 2010, 2012-2020 Ingo Schwarze * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons @@ -42,7 +42,6 @@ typedef void (*v_check)(CHKARGS); -static void check_abort(CHKARGS) __attribute__((__noreturn__)); static void check_par(CHKARGS); static void check_part(CHKARGS); static void check_root(CHKARGS); @@ -67,9 +66,9 @@ post_SH, /* SS */ post_TP, /* TP */ post_TP, /* TQ */ - check_abort,/* LP */ + check_par, /* LP */ check_par, /* PP */ - check_abort,/* P */ + check_par, /* P */ post_IP, /* IP */ NULL, /* HP */ NULL, /* SM */ @@ -110,25 +109,11 @@ const v_check *cp; /* - * Translate obsolete macros such that later code - * does not need to look for them. - */ - - n = man->last; - switch (n->tok) { - case MAN_LP: - case MAN_P: - n->tok = MAN_PP; - break; - default: - break; - } - - /* * Iterate over all children, recursing into each one * in turn, depth-first. */ + n = man->last; man->last = man->last->child; while (man->last != NULL) { man_validate(man); @@ -198,12 +183,6 @@ "(OpenBSD)" : "(NetBSD)"); } -static void -check_abort(CHKARGS) -{ - abort(); -} - /* * Skip leading whitespace, dashes, backslashes, and font escapes, * then create a tag if the first following byte is a letter. @@ -338,7 +317,8 @@ return; } - if (nc->tok == MAN_PP && nc->body->child != NULL) { + if ((nc->tok == MAN_LP || nc->tok == MAN_PP || nc->tok == MAN_P) && + nc->body->child != NULL) { while (nc->body->last != NULL) { man->next = ROFF_NEXT_CHILD; roff_node_relink(man, nc->body->last); @@ -346,7 +326,8 @@ } } - if (nc->tok == MAN_PP || nc->tok == ROFF_sp || nc->tok == ROFF_br) { + if (nc->tok == MAN_LP || nc->tok == MAN_PP || nc->tok == MAN_P || + nc->tok == ROFF_sp || nc->tok == ROFF_br) { mandoc_msg(MANDOCERR_PAR_SKIP, nc->line, nc->pos, "%s after %s", roff_name[nc->tok], roff_name[n->tok]); roff_node_delete(man, nc);