aboutsummaryrefslogtreecommitdiffstats
path: root/msg.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2014-01-12 20:42:08 +0200
committerArnold D. Robbins <arnold@skeeve.com>2014-01-12 20:42:08 +0200
commit624d70844fe63068132adb7c66ea3f8a231e56a7 (patch)
tree79781e2b0e24b5e478804001c83fcde64602f502 /msg.c
parentda83b6857bf0a67b15fc75d31a0b6802ac9baffe (diff)
parentf934f2192779db0091d1706d97d1fd43cb26dc9a (diff)
downloadegawk-624d70844fe63068132adb7c66ea3f8a231e56a7.tar.gz
egawk-624d70844fe63068132adb7c66ea3f8a231e56a7.tar.bz2
egawk-624d70844fe63068132adb7c66ea3f8a231e56a7.zip
Merge branch 'master' into comment
Diffstat (limited to 'msg.c')
-rw-r--r--msg.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/msg.c b/msg.c
index edacdd1c..16fef73a 100644
--- a/msg.c
+++ b/msg.c
@@ -44,15 +44,22 @@ err(bool isfatal, const char *s, const char *emsg, va_list argp)
char *file;
const char *me;
+ static bool first = true;
+ static bool add_src_info = false;
+
+ if (first) {
+ first = false;
+ add_src_info = (getenv("GAWK_MSG_SRC") != NULL);
+ }
+
(void) fflush(output_fp);
me = myname;
(void) fprintf(stderr, "%s: ", me);
-#ifdef GAWKDEBUG
- if (srcfile != NULL) {
+
+ if (srcfile != NULL && add_src_info) {
fprintf(stderr, "%s:%d:", srcfile, srcline);
srcfile = NULL;
}
-#endif /* GAWKDEBUG */
if (sourceline > 0) {
if (source != NULL)
@@ -109,10 +116,10 @@ msg(const char *mesg, ...)
va_end(args);
}
-/* warning --- print a warning message */
+/* r_warning --- print a warning message */
void
-warning(const char *mesg, ...)
+r_warning(const char *mesg, ...)
{
va_list args;
va_start(args, mesg);