From 430c654a41706975e219a5f94a3c73842f75461c Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Sun, 9 May 2010 21:19:42 +0000 Subject: Remove -fno-ign-chars as well-argued by Ingo Schwarze. Patch by Ingo Schwarze, too. --- index.sgml | 9 ++++++++- main.c | 30 ++++++++++-------------------- man.h | 3 +-- man_validate.c | 6 ++---- mandoc.1 | 11 ++++------- mdoc.h | 3 +-- mdoc_validate.c | 17 +++-------------- 7 files changed, 29 insertions(+), 50 deletions(-) diff --git a/index.sgml b/index.sgml index 2c54566b..3e328456 100644 --- a/index.sgml +++ b/index.sgml @@ -238,6 +238,13 @@ + + + diff --git a/main.c b/main.c index 740bd86e..9eee9aea 100644 --- a/main.c +++ b/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.61 2010/04/12 19:27:22 kristaps Exp $ */ +/* $Id: main.c,v 1.62 2010/05/09 21:19:42 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -75,7 +75,6 @@ struct curparse { #define FL_IGN_SCOPE (1 << 0) /* Ignore scope errors. */ #define FL_NIGN_ESCAPE (1 << 1) /* Don't ignore bad escapes. */ #define FL_NIGN_MACRO (1 << 2) /* Don't ignore bad macros. */ -#define FL_NIGN_CHARS (1 << 3) /* Don't ignore bad chars. */ #define FL_IGN_ERRORS (1 << 4) /* Ignore failed parse. */ enum intt inttype; /* Input parsers... */ struct man *man; @@ -91,8 +90,7 @@ struct curparse { }; #define FL_STRICT FL_NIGN_ESCAPE | \ - FL_NIGN_MACRO | \ - FL_NIGN_CHARS + FL_NIGN_MACRO static int foptions(int *, char *); static int toptions(struct curparse *, char *); @@ -246,12 +244,10 @@ man_init(struct curparse *curp) /* Defaults from mandoc.1. */ - pflags = MAN_IGN_MACRO | MAN_IGN_ESCAPE | MAN_IGN_CHARS; + pflags = MAN_IGN_MACRO | MAN_IGN_ESCAPE; if (curp->fflags & FL_NIGN_MACRO) pflags &= ~MAN_IGN_MACRO; - if (curp->fflags & FL_NIGN_CHARS) - pflags &= ~MAN_IGN_CHARS; if (curp->fflags & FL_NIGN_ESCAPE) pflags &= ~MAN_IGN_ESCAPE; @@ -270,7 +266,7 @@ mdoc_init(struct curparse *curp) /* Defaults from mandoc.1. */ - pflags = MDOC_IGN_MACRO | MDOC_IGN_ESCAPE | MDOC_IGN_CHARS; + pflags = MDOC_IGN_MACRO | MDOC_IGN_ESCAPE; if (curp->fflags & FL_IGN_SCOPE) pflags |= MDOC_IGN_SCOPE; @@ -278,8 +274,6 @@ mdoc_init(struct curparse *curp) pflags &= ~MDOC_IGN_ESCAPE; if (curp->fflags & FL_NIGN_MACRO) pflags &= ~MDOC_IGN_MACRO; - if (curp->fflags & FL_NIGN_CHARS) - pflags &= ~MDOC_IGN_CHARS; return(mdoc_alloc(curp, pflags, &mdoccb)); } @@ -590,11 +584,10 @@ foptions(int *fflags, char *arg) toks[0] = "ign-scope"; toks[1] = "no-ign-escape"; toks[2] = "no-ign-macro"; - toks[3] = "no-ign-chars"; - toks[4] = "ign-errors"; - toks[5] = "strict"; - toks[6] = "ign-escape"; - toks[7] = NULL; + toks[3] = "ign-errors"; + toks[4] = "strict"; + toks[5] = "ign-escape"; + toks[6] = NULL; while (*arg) { o = arg; @@ -609,15 +602,12 @@ foptions(int *fflags, char *arg) *fflags |= FL_NIGN_MACRO; break; case (3): - *fflags |= FL_NIGN_CHARS; - break; - case (4): *fflags |= FL_IGN_ERRORS; break; - case (5): + case (4): *fflags |= FL_STRICT; break; - case (6): + case (5): *fflags &= ~FL_NIGN_ESCAPE; break; default: diff --git a/man.h b/man.h index cbcbaea9..856e4192 100644 --- a/man.h +++ b/man.h @@ -1,4 +1,4 @@ -/* $Id: man.h,v 1.27 2010/03/27 10:13:16 kristaps Exp $ */ +/* $Id: man.h,v 1.28 2010/05/09 21:19:42 kristaps Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons * @@ -100,7 +100,6 @@ struct man_node { }; #define MAN_IGN_MACRO (1 << 0) -#define MAN_IGN_CHARS (1 << 1) #define MAN_IGN_ESCAPE (1 << 2) extern const char *const *man_macronames; diff --git a/man_validate.c b/man_validate.c index d4c40093..00cf5e1c 100644 --- a/man_validate.c +++ b/man_validate.c @@ -1,4 +1,4 @@ -/* $Id: man_validate.c,v 1.34 2010/04/03 14:12:48 kristaps Exp $ */ +/* $Id: man_validate.c,v 1.35 2010/05/09 21:19:42 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -229,9 +229,7 @@ check_text(CHKARGS) if ('\t' == *p || isprint((u_char)*p)) continue; - if (MAN_IGN_CHARS & m->pflags) - return(man_pwarn(m, n->line, pos, WNPRINT)); - return(man_perr(m, n->line, pos, WNPRINT)); + return(man_pwarn(m, n->line, pos, WNPRINT)); } return(1); diff --git a/mandoc.1 b/mandoc.1 index fb9bbb48..d1ff24f6 100644 --- a/mandoc.1 +++ b/mandoc.1 @@ -1,4 +1,4 @@ -.\" $Id: mandoc.1,v 1.59 2010/04/13 05:26:49 kristaps Exp $ +.\" $Id: mandoc.1,v 1.60 2010/05/09 21:19:42 kristaps Exp $ .\" .\" Copyright (c) 2009 Kristaps Dzonsons .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: April 13 2010 $ +.Dd $Mdocdate: May 9 2010 $ .Dt MANDOC 1 .Os .Sh NAME @@ -192,18 +192,15 @@ When rewinding the scope of a block macro, forces the compiler to ignore scope violations. This can seriously mangle the resulting tree. .Pq mdoc only -.It Fl f Ns Cm no-ign-chars -Do not ignore disallowed characters. .It Fl f Ns Cm no-ign-escape Do not ignore invalid escape sequences. .It Fl f Ns Cm no-ign-macro Do not ignore unknown macros at the start of input lines. .It Fl f Ns Cm strict Implies -.Fl f Ns Cm no-ign-escape , -.Fl f Ns Cm no-ign-macro , +.Fl f Ns Cm no-ign-escape and -.Fl f Ns Cm no-ign-chars . +.Fl f Ns Cm no-ign-macro . .El .Ss Output Options For the time being, only diff --git a/mdoc.h b/mdoc.h index d56a35fa..2abb1d40 100644 --- a/mdoc.h +++ b/mdoc.h @@ -1,4 +1,4 @@ -/* $Id: mdoc.h,v 1.74 2010/03/31 07:13:53 kristaps Exp $ */ +/* $Id: mdoc.h,v 1.75 2010/05/09 21:19:42 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -275,7 +275,6 @@ struct mdoc_node { #define MDOC_IGN_SCOPE (1 << 0) /* Ignore scope violations. */ #define MDOC_IGN_ESCAPE (1 << 1) /* Ignore bad escape sequences. */ #define MDOC_IGN_MACRO (1 << 2) /* Ignore unknown macros. */ -#define MDOC_IGN_CHARS (1 << 3) /* Ignore disallowed chars. */ /* Call-backs for parse messages. */ diff --git a/mdoc_validate.c b/mdoc_validate.c index b442293c..a25ae856 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_validate.c,v 1.70 2010/05/08 07:30:19 kristaps Exp $ */ +/* $Id: mdoc_validate.c,v 1.71 2010/05/09 21:19:42 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -60,7 +60,6 @@ static int err_child_gt(struct mdoc *, const char *, int); static int warn_child_gt(struct mdoc *, const char *, int); static int err_child_eq(struct mdoc *, const char *, int); static int warn_child_eq(struct mdoc *, const char *, int); -static int warn_print(struct mdoc *, int, int); static int warn_count(struct mdoc *, const char *, int, const char *, int); static int err_count(struct mdoc *, const char *, @@ -323,16 +322,6 @@ mdoc_valid_post(struct mdoc *mdoc) } -static int -warn_print(struct mdoc *m, int ln, int pos) -{ - - if (MDOC_IGN_CHARS & m->pflags) - return(mdoc_pwarn(m, ln, pos, EPRINT)); - return(mdoc_perr(m, ln, pos, EPRINT)); -} - - static inline int warn_count(struct mdoc *m, const char *k, int want, const char *v, int has) @@ -518,10 +507,10 @@ check_text(struct mdoc *mdoc, int line, int pos, const char *p) for ( ; *p; p++, pos++) { if ('\t' == *p) { if ( ! (MDOC_LITERAL & mdoc->flags)) - if ( ! warn_print(mdoc, line, pos)) + if ( ! mdoc_pwarn(mdoc, line, pos, EPRINT)) return(0); } else if ( ! isprint((u_char)*p)) - if ( ! warn_print(mdoc, line, pos)) + if ( ! mdoc_pwarn(mdoc, line, pos, EPRINT)) return(0); if ('\\' != *p) -- cgit v1.2.3-56-ge451
09-05-2010 + Fixed handling of \*(Ba escape. Backed out -fno-ign-chars (pointless complexity). + Version: 1.9.24. +
09-05-2010 @@ -336,7 +343,7 @@
- Copyright © 2008–2010 Kristaps Dzonsons, $Date: 2010/05/09 06:50:23 $ + Copyright © 2008–2010 Kristaps Dzonsons, $Date: 2010/05/09 21:19:42 $