diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2017-06-17 16:47:48 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2017-06-17 16:47:48 +0000 |
commit | fc10222b160be65e60f5afcce864bcc8a49b6b48 (patch) | |
tree | 661ae846db34c5ec18bd00ddb2a6f3c1de20329a /man_validate.c | |
parent | 49598c9d922bda8ee429befd0845df1e70a49217 (diff) | |
download | mandoc-fc10222b160be65e60f5afcce864bcc8a49b6b48.tar.gz mandoc-fc10222b160be65e60f5afcce864bcc8a49b6b48.tar.zst mandoc-fc10222b160be65e60f5afcce864bcc8a49b6b48.zip |
if .in is used inside the .TP head, it's always relative
Diffstat (limited to 'man_validate.c')
-rw-r--r-- | man_validate.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/man_validate.c b/man_validate.c index 64f54a4f..759c42ac 100644 --- a/man_validate.c +++ b/man_validate.c @@ -47,11 +47,12 @@ static void check_text(CHKARGS); static void post_AT(CHKARGS); static void post_IP(CHKARGS); -static void post_vs(CHKARGS); static void post_OP(CHKARGS); static void post_TH(CHKARGS); static void post_UC(CHKARGS); static void post_UR(CHKARGS); +static void post_in(CHKARGS); +static void post_vs(CHKARGS); static const v_check __man_valids[MAN_MAX - MAN_TH] = { post_TH, /* TH */ @@ -82,7 +83,7 @@ static const v_check __man_valids[MAN_MAX - MAN_TH] = { post_UC, /* UC */ NULL, /* PD */ post_AT, /* AT */ - NULL, /* in */ + post_in, /* in */ post_OP, /* OP */ NULL, /* EX */ NULL, /* EE */ @@ -435,6 +436,22 @@ post_AT(CHKARGS) } static void +post_in(CHKARGS) +{ + char *s; + + if (n->parent->tok != MAN_TP || + n->parent->type != ROFFT_HEAD || + n->child == NULL || + *n->child->string == '+' || + *n->child->string == '-') + return; + mandoc_asprintf(&s, "+%s", n->child->string); + free(n->child->string); + n->child->string = s; +} + +static void post_vs(CHKARGS) { |