=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mdoc_validate.c,v retrieving revision 1.237 retrieving revision 1.238 diff -c -r1.237 -r1.238 *** src/usr.bin/mandoc/mdoc_validate.c 2017/04/28 16:23:30 1.237 --- src/usr.bin/mandoc/mdoc_validate.c 2017/04/29 12:43:55 1.238 *************** *** 1,4 **** ! /* $OpenBSD: mdoc_validate.c,v 1.237 2017/04/28 16:23:30 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2017 Ingo Schwarze --- 1,4 ---- ! /* $OpenBSD: mdoc_validate.c,v 1.238 2017/04/29 12:43:55 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2017 Ingo Schwarze *************** *** 56,62 **** static void check_args(struct roff_man *, struct roff_node *); static int child_an(const struct roff_node *); static size_t macro2len(enum roff_tok); ! static void rewrite_macro2len(char **); static void post_an(POST_ARGS); static void post_an_norm(POST_ARGS); --- 56,62 ---- static void check_args(struct roff_man *, struct roff_node *); static int child_an(const struct roff_node *); static size_t macro2len(enum roff_tok); ! static void rewrite_macro2len(struct roff_man *, char **); static void post_an(POST_ARGS); static void post_an_norm(POST_ARGS); *************** *** 449,455 **** mdoc->parse, argv->line, argv->pos, "Bl -width %s", argv->value[0]); ! rewrite_macro2len(argv->value); n->norm->Bl.width = argv->value[0]; break; case MDOC_Offset: --- 449,455 ---- mdoc->parse, argv->line, argv->pos, "Bl -width %s", argv->value[0]); ! rewrite_macro2len(mdoc, argv->value); n->norm->Bl.width = argv->value[0]; break; case MDOC_Offset: *************** *** 464,470 **** mdoc->parse, argv->line, argv->pos, "Bl -offset %s", argv->value[0]); ! rewrite_macro2len(argv->value); n->norm->Bl.offs = argv->value[0]; break; default: --- 464,470 ---- mdoc->parse, argv->line, argv->pos, "Bl -offset %s", argv->value[0]); ! rewrite_macro2len(mdoc, argv->value); n->norm->Bl.offs = argv->value[0]; break; default: *************** *** 591,597 **** mdoc->parse, argv->line, argv->pos, "Bd -offset %s", argv->value[0]); ! rewrite_macro2len(argv->value); n->norm->Bd.offs = argv->value[0]; break; case MDOC_Compact: --- 591,597 ---- mdoc->parse, argv->line, argv->pos, "Bd -offset %s", argv->value[0]); ! rewrite_macro2len(mdoc, argv->value); n->norm->Bd.offs = argv->value[0]; break; case MDOC_Compact: *************** *** 1326,1333 **** * If the argument of -offset or -width is a macro, * replace it with the associated default width. */ ! void ! rewrite_macro2len(char **arg) { size_t width; enum roff_tok tok; --- 1326,1333 ---- * If the argument of -offset or -width is a macro, * replace it with the associated default width. */ ! static void ! rewrite_macro2len(struct roff_man *mdoc, char **arg) { size_t width; enum roff_tok tok; *************** *** 1336,1342 **** return; else if ( ! strcmp(*arg, "Ds")) width = 6; ! else if ((tok = mdoc_hash_find(*arg)) == TOKEN_NONE) return; else width = macro2len(tok); --- 1336,1342 ---- return; else if ( ! strcmp(*arg, "Ds")) width = 6; ! else if ((tok = roffhash_find(mdoc->mdocmac, *arg, 0)) == TOKEN_NONE) return; else width = macro2len(tok);