* mdocml: Reduce the verbosity of error messages caused by open(2)
@ 2014-06-21 22:24 schwarze
0 siblings, 0 replies; only message in thread
From: schwarze @ 2014-06-21 22:24 UTC (permalink / raw)
To: source
Log Message:
-----------
Reduce the verbosity of error messages caused by open(2) failures.
Suggested by and ok jmc@.
Modified Files:
--------------
mdocml:
main.c
read.c
Revision Data
-------------
Index: read.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/read.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -Lread.c -Lread.c -u -p -r1.50 -r1.51
--- read.c
+++ read.c
@@ -210,7 +210,7 @@ static const char * const mandocerrs[MAN
"static buffer exhausted",
/* system errors */
- "cannot open file",
+ NULL,
"cannot stat file",
"cannot read file",
};
Index: main.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/main.c,v
retrieving revision 1.176
retrieving revision 1.177
diff -Lmain.c -Lmain.c -u -p -r1.176 -r1.177
--- main.c
+++ main.c
@@ -411,14 +411,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);
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-06-21 22:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-21 22:24 mdocml: Reduce the verbosity of error messages caused by open(2) schwarze
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).