diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-07-27 19:43:02 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-07-27 19:43:02 +0000 |
commit | b00fcba133e2170f5308eb02bfa9b9b8d7dea0a0 (patch) | |
tree | cc2381829bd6658e8c0cd731faafa3e3bc1a0ac2 /main.c | |
parent | 5226c4fdcd61545e72ba42ed649a213a893e2411 (diff) | |
download | mandoc-b00fcba133e2170f5308eb02bfa9b9b8d7dea0a0.tar.gz |
main.c using fprintf instead of warnx for parse errors (like cc).
Error string is now file:line:col: message.
Removed sed from vim -q example in manuals.7.
Fixed column reporting (off by one).
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -418,7 +418,7 @@ 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", curp->file); return(0); } @@ -639,8 +639,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); } @@ -656,13 +656,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); } |