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 | c92be367f7c707418fe2a4beb17688dffa614781 (patch) | |
tree | ad1bf921cea730c33b344ec8d7a420a9c758d32d /mdoc_validate.c | |
parent | a560a18cf09008f29e00db4014ecd394727489c8 (diff) | |
download | mandoc-c92be367f7c707418fe2a4beb17688dffa614781.tar.gz |
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 | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c index 9f905b69..388cb6a7 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -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; |