diff options
author | 2009-08-22 17:21:23 +0000 | |
---|---|---|
committer | 2009-08-22 17:21:23 +0000 | |
commit | 02aedc9df5caed566658d240f9254691e712822b (patch) | |
tree | 219a1cd68120cde6ee947dccacadc067626f7bd8 | |
parent | sync to 1.8.5: partial rewrite of the handling of escape sequences: (diff) | |
download | wireguard-openbsd-02aedc9df5caed566658d240f9254691e712822b.tar.xz wireguard-openbsd-02aedc9df5caed566658d240f9254691e712822b.zip |
sync to 1.8.5: Error string is now file:line:col: message.
Fixed column reporting (off by one).
Use fprintf instead of warnx for parse errors (like cc).
-rw-r--r-- | usr.bin/mandoc/main.c | 14 | ||||
-rw-r--r-- | usr.bin/mandoc/mdoc.c | 6 |
2 files changed, 10 insertions, 10 deletions
diff --git a/usr.bin/mandoc/main.c b/usr.bin/mandoc/main.c index ce24376a3bb..f08a38e4e4d 100644 --- a/usr.bin/mandoc/main.c +++ b/usr.bin/mandoc/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.14 2009/08/22 14:56:03 schwarze Exp $ */ +/* $Id: main.c,v 1.15 2009/08/22 17:21:23 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -405,7 +405,8 @@ fdesc(struct buf *blk, struct buf *ln, struct curparse *curp) /* NOTE a parser may not have been assigned, yet. */ if ( ! (man || mdoc)) { - warnx("%s: not a manual", curp->file); + (void)fprintf(stderr, "%s: not a manual\n", + curp->file); return(0); } @@ -626,8 +627,8 @@ merr(void *arg, int line, int col, const char *msg) curp = (struct curparse *)arg; - warnx("%s:%d: error: %s (column %d)", - curp->file, line, msg, col); + (void)fprintf(stderr, "%s:%d:%d: error: %s\n", + curp->file, line, col + 1, msg); return(0); } @@ -643,13 +644,12 @@ mwarn(void *arg, int line, int col, const char *msg) if ( ! (curp->wflags & WARN_WALL)) return(1); - warnx("%s:%d: warning: %s (column %d)", - curp->file, line, msg, col); + (void)fprintf(stderr, "%s:%d:%d: warning: %s\n", + curp->file, line, col + 1, msg); if ( ! (curp->wflags & WARN_WERR)) return(1); - warnx("considering warnings as errors"); return(0); } diff --git a/usr.bin/mandoc/mdoc.c b/usr.bin/mandoc/mdoc.c index 12ffcca65c2..13611c01067 100644 --- a/usr.bin/mandoc/mdoc.c +++ b/usr.bin/mandoc/mdoc.c @@ -1,4 +1,4 @@ -/* $Id: mdoc.c,v 1.22 2009/07/26 22:48:41 schwarze Exp $ */ +/* $Id: mdoc.c,v 1.23 2009/08/22 17:21:24 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -653,10 +653,10 @@ static int macrowarn(struct mdoc *m, int ln, const char *buf) { if ( ! (MDOC_IGN_MACRO & m->pflags)) - return(mdoc_verr(m, ln, 1, + return(mdoc_verr(m, ln, 0, "unknown macro: %s%s", buf, strlen(buf) > 3 ? "..." : "")); - return(mdoc_vwarn(m, ln, 1, "unknown macro: %s%s", + return(mdoc_vwarn(m, ln, 0, "unknown macro: %s%s", buf, strlen(buf) > 3 ? "..." : "")); } |