]> git.cameronkatri.com Git - mandoc.git/commitdiff
Removed escape-deprecation note (better solution in progress, schwarze@openbsd.org).
authorKristaps Dzonsons <kristaps@bsd.lv>
Sat, 27 Jun 2009 09:03:03 +0000 (09:03 +0000)
committerKristaps Dzonsons <kristaps@bsd.lv>
Sat, 27 Jun 2009 09:03:03 +0000 (09:03 +0000)
Using EXIT_FAILURE for parse errors (nicm@openbsd.org).
Fixed use of warn/warnx (nicm@openbsd.org).
Fixed use of getsubopt (nicm@openbsd.org).

main.c
mdoc_validate.c

diff --git a/main.c b/main.c
index 98c6e4cda79168b5a6c1a90b733f339011fc3e5d..4e1e587b02f71e6425badad38be50ec89877275a 100644 (file)
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/*     $Id: main.c,v 1.31 2009/06/18 10:32:00 kristaps Exp $ */
+/*     $Id: main.c,v 1.32 2009/06/27 09:03:03 kristaps Exp $ */
 /*
  * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
  *
@@ -132,19 +132,19 @@ main(int argc, char *argv[])
                switch (c) {
                case ('f'):
                        if ( ! foptions(&curp.fflags, optarg))
-                               return(0);
+                               return(EXIT_FAILURE);
                        break;
                case ('m'):
                        if ( ! moptions(&curp.inttype, optarg))
-                               return(0);
+                               return(EXIT_FAILURE);
                        break;
                case ('T'):
                        if ( ! toptions(&curp.outtype, optarg))
-                               return(0);
+                               return(EXIT_FAILURE);
                        break;
                case ('W'):
                        if ( ! woptions(&curp.wflags, optarg))
-                               return(0);
+                               return(EXIT_FAILURE);
                        break;
                case ('V'):
                        version();
@@ -318,7 +318,7 @@ fdesc(struct buf *blk, struct buf *ln, struct curparse *curp)
         */
 
        if (-1 == fstat(curp->fd, &st))
-               warnx("%s", curp->file);
+               warn("%s", curp->file);
        else if ((size_t)st.st_blksize > sz)
                sz = st.st_blksize;
 
@@ -581,7 +581,7 @@ foptions(int *fflags, char *arg)
                                   NO_IGN_MACRO | NO_IGN_CHARS;
                        break;
                default:
-                       warnx("bad argument: -f%s", arg);
+                       warnx("bad argument: -f%s", suboptarg);
                        return(0);
                }
 
@@ -616,7 +616,7 @@ woptions(int *wflags, char *arg)
                        *wflags |= WARN_WERR;
                        break;
                default:
-                       warnx("bad argument: -W%s", arg);
+                       warnx("bad argument: -W%s", suboptarg);
                        return(0);
                }
 
index 48751d870ab5358644345abe8a9d1324364c0413..994ca9da7a6a53f8f979231c53f9d91cbad29700 100644 (file)
@@ -1,4 +1,4 @@
-/*     $Id: mdoc_validate.c,v 1.16 2009/06/18 20:46:19 kristaps Exp $ */
+/*     $Id: mdoc_validate.c,v 1.17 2009/06/27 09:03:03 kristaps Exp $ */
 /*
  * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
  *
@@ -55,7 +55,6 @@ enum  mwarn {
        WNOWIDTH,
        WMISSWIDTH,
        WESCAPE,
-       WDEPESC,
        WDEPCOL,
        WWRONGMSEC,
        WSECOOO,
@@ -486,9 +485,6 @@ pwarn(struct mdoc *m, int line, int pos, enum mwarn type)
        case (WESCAPE):
                p = "invalid escape sequence";
                break;
-       case (WDEPESC):
-               p = "deprecated special-character escape";
-               break;
        case (WNOLINE):
                p = "suggested no line arguments";
                break;
@@ -728,10 +724,6 @@ check_text(struct mdoc *mdoc, int line, int pos, const char *p)
 
                c = mdoc_isescape(p);
                if (c) {
-                       /* See if form is deprecated. */
-                       if ('*' == p[1]) 
-                               if ( ! pwarn(mdoc, line, pos, WDEPESC))
-                                       return(0);
                        p += (int)c - 1;
                        continue;
                }