summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--man_html.c13
-rw-r--r--man_term.c12
-rw-r--r--man_validate.c33
3 files changed, 12 insertions, 46 deletions
diff --git a/man_html.c b/man_html.c
index f931dcb9..630e2856 100644
--- a/man_html.c
+++ b/man_html.c
@@ -60,7 +60,6 @@ static int man_SH_pre(MAN_ARGS);
static int man_SM_pre(MAN_ARGS);
static int man_SY_pre(MAN_ARGS);
static int man_UR_pre(MAN_ARGS);
-static int man_abort_pre(MAN_ARGS);
static int man_alt_pre(MAN_ARGS);
static int man_ign_pre(MAN_ARGS);
static int man_in_pre(MAN_ARGS);
@@ -75,9 +74,9 @@ static const struct man_html_act man_html_acts[MAN_MAX - MAN_TH] = {
{ man_SH_pre, NULL }, /* SS */
{ man_IP_pre, NULL }, /* TP */
{ man_IP_pre, NULL }, /* TQ */
- { man_abort_pre, NULL }, /* LP */
+ { man_PP_pre, NULL }, /* LP */
{ man_PP_pre, NULL }, /* PP */
- { man_abort_pre, NULL }, /* P */
+ { man_PP_pre, NULL }, /* P */
{ man_IP_pre, NULL }, /* IP */
{ man_PP_pre, NULL }, /* HP */
{ man_SM_pre, NULL }, /* SM */
@@ -406,7 +405,7 @@ man_PP_pre(MAN_ARGS)
if (n->child != NULL &&
(n->child->flags & NODE_NOFILL) == 0)
print_otag(h, TAG_P, "c",
- n->tok == MAN_PP ? "Pp" : "Pp HP");
+ n->tok == MAN_HP ? "Pp HP" : "Pp");
break;
default:
abort();
@@ -635,9 +634,3 @@ man_UR_pre(MAN_ARGS)
print_man_nodelist(man, n->child, h);
return 0;
}
-
-static int
-man_abort_pre(MAN_ARGS)
-{
- abort();
-}
diff --git a/man_term.c b/man_term.c
index 0b839887..a45a0ed2 100644
--- a/man_term.c
+++ b/man_term.c
@@ -83,7 +83,6 @@ static int pre_SS(DECL_ARGS);
static int pre_SY(DECL_ARGS);
static int pre_TP(DECL_ARGS);
static int pre_UR(DECL_ARGS);
-static int pre_abort(DECL_ARGS);
static int pre_alternate(DECL_ARGS);
static int pre_ign(DECL_ARGS);
static int pre_in(DECL_ARGS);
@@ -103,9 +102,9 @@ static const struct man_term_act man_term_acts[MAN_MAX - MAN_TH] = {
{ pre_SS, post_SH, 0 }, /* SS */
{ pre_TP, post_TP, 0 }, /* TP */
{ pre_TP, post_TP, 0 }, /* TQ */
- { pre_abort, NULL, 0 }, /* LP */
+ { pre_PP, NULL, 0 }, /* LP */
{ pre_PP, NULL, 0 }, /* PP */
- { pre_abort, NULL, 0 }, /* P */
+ { pre_PP, NULL, 0 }, /* P */
{ pre_IP, post_IP, 0 }, /* IP */
{ pre_HP, post_HP, 0 }, /* HP */
{ NULL, NULL, 0 }, /* SM */
@@ -225,13 +224,6 @@ print_bvspace(struct termp *p, struct roff_node *n, int pardist)
term_vspace(p);
}
-
-static int
-pre_abort(DECL_ARGS)
-{
- abort();
-}
-
static int
pre_ign(DECL_ARGS)
{
diff --git a/man_validate.c b/man_validate.c
index 1f3c0159..722e4fdc 100644
--- a/man_validate.c
+++ b/man_validate.c
@@ -44,7 +44,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);
@@ -69,9 +68,9 @@ static const v_check man_valids[MAN_MAX - MAN_TH] = {
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 */
@@ -112,25 +111,11 @@ man_validate(struct roff_man *man)
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);
@@ -200,12 +185,6 @@ check_root(CHKARGS)
"(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.
@@ -340,7 +319,8 @@ post_SH(CHKARGS)
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);
@@ -348,7 +328,8 @@ post_SH(CHKARGS)
}
}
- 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);