From 820b4d56427ff6a0f1e3399ac7e4aea447dd5c20 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 3 Dec 2018 21:00:10 +0000 Subject: In the validators, translate obsolete macro aliases (Lp, Ot, LP, P) to the standard forms (Pp, Ft, PP) up front, such that later code does not need to look for the obsolete versions. This reduces the risk of incomplete handling. --- mdoc_man.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'mdoc_man.c') diff --git a/mdoc_man.c b/mdoc_man.c index c1d0bec9..f3689dfc 100644 --- a/mdoc_man.c +++ b/mdoc_man.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_man.c,v 1.128 2018/08/23 19:33:27 schwarze Exp $ */ +/* $Id: mdoc_man.c,v 1.129 2018/12/03 21:00:10 schwarze Exp $ */ /* * Copyright (c) 2011-2018 Ingo Schwarze * @@ -75,6 +75,7 @@ static void post_pf(DECL_ARGS); static void post_sect(DECL_ARGS); static void post_vt(DECL_ARGS); static int pre__t(DECL_ARGS); +static int pre_abort(DECL_ARGS); static int pre_an(DECL_ARGS); static int pre_ap(DECL_ARGS); static int pre_aq(DECL_ARGS); @@ -172,7 +173,7 @@ static const struct mdoc_man_act mdoc_man_acts[MDOC_MAX - MDOC_Dd] = { { cond_head, pre_enc, NULL, "\\- ", NULL }, /* Nd */ { NULL, pre_nm, post_nm, NULL, NULL }, /* Nm */ { cond_body, pre_enc, post_enc, "[", "]" }, /* Op */ - { NULL, pre_Ft, post_font, NULL, NULL }, /* Ot */ + { NULL, pre_abort, NULL, NULL, NULL }, /* Ot */ { NULL, pre_em, post_font, NULL, NULL }, /* Pa */ { NULL, pre_ex, NULL, NULL, NULL }, /* Rv */ { NULL, NULL, NULL, NULL, NULL }, /* St */ @@ -245,7 +246,7 @@ static const struct mdoc_man_act mdoc_man_acts[MDOC_MAX - MDOC_Dd] = { { NULL, pre_em, post_font, NULL, NULL }, /* Fr */ { NULL, NULL, NULL, NULL, NULL }, /* Ud */ { NULL, NULL, post_lb, NULL, NULL }, /* Lb */ - { NULL, pre_pp, NULL, NULL, NULL }, /* Lp */ + { NULL, pre_abort, NULL, NULL, NULL }, /* Lp */ { NULL, pre_lk, NULL, NULL, NULL }, /* Lk */ { NULL, pre_em, post_font, NULL, NULL }, /* Mt */ { cond_body, pre_enc, post_enc, "{", "}" }, /* Brq */ @@ -724,6 +725,12 @@ cond_body(DECL_ARGS) return n->type == ROFFT_BODY; } +static int +pre_abort(DECL_ARGS) +{ + abort(); +} + static int pre_enc(DECL_ARGS) { -- cgit v1.2.3