diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2014-06-21 22:23:45 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2014-06-21 22:23:45 +0000 |
commit | 719cb2cdcfa4c55bb7236c12579f2d2dce2d96b0 (patch) | |
tree | 50a4a7944ac6cd63307b0bf970c218aefff7b29c /usr.bin/mandoc/main.c | |
parent | 538fef73972f727b498c2c2eea4499359b48a0ca (diff) |
Reduce the verbosity of error messages caused by open(2) failures.
Suggested by and ok jmc@.
Diffstat (limited to 'usr.bin/mandoc/main.c')
-rw-r--r-- | usr.bin/mandoc/main.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/mandoc/main.c b/usr.bin/mandoc/main.c index 4be08974820..6e03ce84016 100644 --- a/usr.bin/mandoc/main.c +++ b/usr.bin/mandoc/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.93 2014/06/21 16:17:56 schwarze Exp $ */ +/* $Id: main.c,v 1.94 2014/06/21 22:23:44 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010, 2011, 2012, 2014 Ingo Schwarze <schwarze@openbsd.org> @@ -412,14 +412,17 @@ static void mmsg(enum mandocerr t, enum mandoclevel lvl, const char *file, int line, int col, const char *msg) { + const char *mparse_msg; fprintf(stderr, "%s: %s:", progname, file); if (line) fprintf(stderr, "%d:%d:", line, col + 1); - fprintf(stderr, " %s: %s", mparse_strlevel(lvl), - mparse_strerror(t)); + fprintf(stderr, " %s", mparse_strlevel(lvl)); + + if (NULL != (mparse_msg = mparse_strerror(t))) + fprintf(stderr, ": %s", mparse_msg); if (msg) fprintf(stderr, ": %s", msg); |