aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-06-20 16:11:42 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-06-20 16:11:42 +0000
commit8358cc737b994d172459eaf3401807c2b0d3811c (patch)
tree3dcf1761a443a5ca45feef0cced4d0bf08da2382
parentb7a2831fbcd6d60e1569cdd4aa4e19945ffd5c60 (diff)
downloadmandoc-8358cc737b994d172459eaf3401807c2b0d3811c.tar.gz
mandoc-8358cc737b994d172459eaf3401807c2b0d3811c.tar.zst
mandoc-8358cc737b994d172459eaf3401807c2b0d3811c.zip
Prefix error messages from mandoc(1) with "mandoc: "
just like almost all other utility programs do. Suggested by nick@ who wondered where messages came from when calling mandoc(1) from inside a Perl script. ok jmc@ nick@
-rw-r--r--main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/main.c b/main.c
index 75a75f11..c1497761 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.173 2014/04/20 16:46:04 schwarze Exp $ */
+/* $Id: main.c,v 1.174 2014/06/20 16:11:42 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2011, 2012, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -408,7 +408,8 @@ mmsg(enum mandocerr t, enum mandoclevel lvl,
const char *file, int line, int col, const char *msg)
{
- fprintf(stderr, "%s:%d:%d: %s: %s", file, line, col + 1,
+ fprintf(stderr, "%s: %s:%d:%d: %s: %s", progname,
+ file, line, col + 1,
mparse_strlevel(lvl), mparse_strerror(t));
if (msg)