=================================================================== RCS file: /cvs/mandoc/man_validate.c,v retrieving revision 1.41 retrieving revision 1.45 diff -u -p -r1.41 -r1.45 --- mandoc/man_validate.c 2010/05/17 22:11:42 1.41 +++ mandoc/man_validate.c 2010/06/28 14:39:17 1.45 @@ -1,6 +1,6 @@ -/* $Id: man_validate.c,v 1.41 2010/05/17 22:11:42 kristaps Exp $ */ +/* $Id: man_validate.c,v 1.45 2010/06/28 14:39:17 kristaps Exp $ */ /* - * Copyright (c) 2008, 2009 Kristaps Dzonsons + * Copyright (c) 2008, 2009 Kristaps Dzonsons * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -31,7 +31,7 @@ #include "libman.h" #include "libmandoc.h" -#define CHKARGS struct man *m, const struct man_node *n +#define CHKARGS struct man *m, struct man_node *n typedef int (*v_check)(CHKARGS); @@ -101,7 +101,7 @@ static const struct man_valid man_valids[MAN_MAX] = { int -man_valid_pre(struct man *m, const struct man_node *n) +man_valid_pre(struct man *m, struct man_node *n) { v_check *cp; @@ -204,7 +204,7 @@ check_title(CHKARGS) static int check_text(CHKARGS) { - const char *p; + char *p; int pos, c; assert(n->string); @@ -223,7 +223,12 @@ check_text(CHKARGS) return(c); } - if ('\t' == *p || isprint((u_char)*p)) + /* + * FIXME: we absolutely cannot let \b get through or it + * will destroy some assumptions in terms of format. + */ + + if ('\t' == *p || isprint((u_char)*p) || ASCII_HYPH == *p) continue; if ( ! man_pmsg(m, n->line, pos, MANDOCERR_BADCHAR)) return(0);