diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-06-09 19:22:56 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-06-09 19:22:56 +0000 |
commit | 1aea6f050761f70bdfd8647816b23774b971050c (patch) | |
tree | 19a97688898c1237faec76c3bb3fa8482be3a7a1 /mdoc_validate.c | |
parent | b4405b88c62581d578f4465b708c626057de8d4a (diff) | |
download | mandoc-1aea6f050761f70bdfd8647816b23774b971050c.tar.gz mandoc-1aea6f050761f70bdfd8647816b23774b971050c.tar.zst mandoc-1aea6f050761f70bdfd8647816b23774b971050c.zip |
Squash bug noted by Ulrich Spoerlein where "-" were being converted to
ASCII_HYPH, as per normal, but were screwing up mandoc_special(). Fixed
by making mandoc_special() first check isspace() instead of ! isgraph(),
then normalise its string as it passes out. This require de-constifying
some validation routines not already de-constified (those in libman),
but that's ok, because I'd like to be pushing actions into validation
routines to save on space and redundant calculations.
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r-- | mdoc_validate.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c index 85f64743..e621a2c1 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_validate.c,v 1.91 2010/06/03 13:44:36 kristaps Exp $ */ +/* $Id: mdoc_validate.c,v 1.92 2010/06/09 19:22:56 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -47,12 +47,10 @@ struct valids { static int check_parent(PRE_ARGS, enum mdoct, enum mdoc_type); static int check_stdarg(PRE_ARGS); -static int check_text(struct mdoc *, int, int, const char *); +static int check_text(struct mdoc *, int, int, char *); static int check_argv(struct mdoc *, - const struct mdoc_node *, - const struct mdoc_argv *); -static int check_args(struct mdoc *, - const struct mdoc_node *); + struct mdoc_node *, struct mdoc_argv *); +static int check_args(struct mdoc *, struct mdoc_node *); static int err_child_lt(struct mdoc *, const char *, int); static int warn_child_lt(struct mdoc *, const char *, int); static int err_child_gt(struct mdoc *, const char *, int); @@ -277,7 +275,7 @@ mdoc_valid_pre(struct mdoc *mdoc, struct mdoc_node *n) { v_pre *p; int line, pos; - const char *tp; + char *tp; if (MDOC_TEXT == n->type) { tp = n->string; @@ -419,7 +417,7 @@ check_stdarg(PRE_ARGS) static int -check_args(struct mdoc *m, const struct mdoc_node *n) +check_args(struct mdoc *m, struct mdoc_node *n) { int i; @@ -436,8 +434,7 @@ check_args(struct mdoc *m, const struct mdoc_node *n) static int -check_argv(struct mdoc *m, const struct mdoc_node *n, - const struct mdoc_argv *v) +check_argv(struct mdoc *m, struct mdoc_node *n, struct mdoc_argv *v) { int i; @@ -457,7 +454,7 @@ check_argv(struct mdoc *m, const struct mdoc_node *n, static int -check_text(struct mdoc *mdoc, int line, int pos, const char *p) +check_text(struct mdoc *mdoc, int line, int pos, char *p) { int c; |