version 1.335, 2017/06/11 14:24:55 |
version 1.336, 2017/06/11 17:16:51 |
Line 53 typedef void (*v_post)(POST_ARGS); |
|
Line 53 typedef void (*v_post)(POST_ARGS); |
|
|
|
static int build_list(struct roff_man *, int); |
static int build_list(struct roff_man *, int); |
static void check_text(struct roff_man *, int, int, char *); |
static void check_text(struct roff_man *, int, int, char *); |
static void check_bsd(struct roff_man *, int, int, char *); |
|
static void check_argv(struct roff_man *, |
static void check_argv(struct roff_man *, |
struct roff_node *, struct mdoc_argv *); |
struct roff_node *, struct mdoc_argv *); |
static void check_args(struct roff_man *, struct roff_node *); |
static void check_args(struct roff_man *, struct roff_node *); |
|
static void check_toptext(struct roff_man *, int, int, const char *); |
static int child_an(const struct roff_node *); |
static int child_an(const struct roff_node *); |
static size_t macro2len(enum roff_tok); |
static size_t macro2len(enum roff_tok); |
static void rewrite_macro2len(struct roff_man *, char **); |
static void rewrite_macro2len(struct roff_man *, char **); |
Line 304 mdoc_node_validate(struct roff_man *mdoc) |
|
Line 304 mdoc_node_validate(struct roff_man *mdoc) |
|
if (n->sec != SEC_SYNOPSIS || |
if (n->sec != SEC_SYNOPSIS || |
(n->parent->tok != MDOC_Cd && n->parent->tok != MDOC_Fd)) |
(n->parent->tok != MDOC_Cd && n->parent->tok != MDOC_Fd)) |
check_text(mdoc, n->line, n->pos, n->string); |
check_text(mdoc, n->line, n->pos, n->string); |
if (n->parent->tok == MDOC_Sh || |
if (n->parent->tok == MDOC_It || |
n->parent->tok == MDOC_Ss || |
(n->parent->type == ROFFT_BODY && |
n->parent->tok == MDOC_It) |
(n->parent->tok == MDOC_Sh || |
check_bsd(mdoc, n->line, n->pos, n->string); |
n->parent->tok == MDOC_Ss))) |
|
check_toptext(mdoc, n->line, n->pos, n->string); |
break; |
break; |
case ROFFT_EQN: |
case ROFFT_EQN: |
case ROFFT_TBL: |
case ROFFT_TBL: |
Line 390 check_text(struct roff_man *mdoc, int ln, int pos, cha |
|
Line 391 check_text(struct roff_man *mdoc, int ln, int pos, cha |
|
} |
} |
|
|
static void |
static void |
check_bsd(struct roff_man *mdoc, int ln, int pos, char *p) |
check_toptext(struct roff_man *mdoc, int ln, int pos, const char *p) |
{ |
{ |
const char *cp; |
const char *cp, *cpr; |
|
|
|
if (*p == '\0') |
|
return; |
|
|
if ((cp = strstr(p, "OpenBSD")) != NULL) |
if ((cp = strstr(p, "OpenBSD")) != NULL) |
mandoc_msg(MANDOCERR_BX, mdoc->parse, |
mandoc_msg(MANDOCERR_BX, mdoc->parse, |
ln, pos + (cp - p), "Ox"); |
ln, pos + (cp - p), "Ox"); |
Line 406 check_bsd(struct roff_man *mdoc, int ln, int pos, char |
|
Line 410 check_bsd(struct roff_man *mdoc, int ln, int pos, char |
|
if ((cp = strstr(p, "DragonFly")) != NULL) |
if ((cp = strstr(p, "DragonFly")) != NULL) |
mandoc_msg(MANDOCERR_BX, mdoc->parse, |
mandoc_msg(MANDOCERR_BX, mdoc->parse, |
ln, pos + (cp - p), "Dx"); |
ln, pos + (cp - p), "Dx"); |
|
|
|
cp = p; |
|
while ((cp = strstr(cp + 1, "()")) != NULL) { |
|
for (cpr = cp - 1; cpr >= p; cpr--) |
|
if (*cpr != '_' && !isalnum((unsigned char)*cpr)) |
|
break; |
|
if ((cpr < p || *cpr == ' ') && cpr + 1 < cp) { |
|
cpr++; |
|
mandoc_vmsg(MANDOCERR_FUNC, mdoc->parse, |
|
ln, pos + (cpr - p), |
|
"%.*s()", (int)(cp - cpr), cpr); |
|
} |
|
} |
} |
} |
|
|
static void |
static void |