aboutsummaryrefslogtreecommitdiffstats
path: root/msg.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2019-04-21 15:04:14 +0300
committerArnold D. Robbins <arnold@skeeve.com>2019-04-21 15:04:14 +0300
commitdfb4f3b18cc0490cf1db9dad021fce62a99443b5 (patch)
tree73521ae6691edc38c503a20725135a7a7ac95d93 /msg.c
parent3ee06fa46236117ccb00fe4e832e7a7e4694f7f8 (diff)
parent847657fa4ec580658371d6fcaea547f7769fb569 (diff)
downloadegawk-dfb4f3b18cc0490cf1db9dad021fce62a99443b5.tar.gz
egawk-dfb4f3b18cc0490cf1db9dad021fce62a99443b5.tar.bz2
egawk-dfb4f3b18cc0490cf1db9dad021fce62a99443b5.zip
Merge branch 'gawk-5.0-stable'
Diffstat (limited to 'msg.c')
-rw-r--r--msg.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/msg.c b/msg.c
index 12cc2aac..ca988ad3 100644
--- a/msg.c
+++ b/msg.c
@@ -46,10 +46,17 @@ err(bool isfatal, const char *s, const char *emsg, va_list argp)
static bool first = true;
static bool add_src_info = false;
+ static long lineno_val = 0; // Easter Egg
if (first) {
first = false;
add_src_info = (getenv("GAWK_MSG_SRC") != NULL);
+ if (! do_traditional) {
+ NODE *n = lookup("LINENO");
+
+ if (n != NULL && n->type == Node_var)
+ lineno_val = get_number_d(n->var_value);
+ }
}
(void) fflush(output_fp);
@@ -67,7 +74,7 @@ err(bool isfatal, const char *s, const char *emsg, va_list argp)
else
(void) fprintf(stderr, _("cmd. line:"));
- (void) fprintf(stderr, "%d: ", sourceline);
+ (void) fprintf(stderr, "%d: ", sourceline + lineno_val);
}
#ifdef HAVE_MPFR