diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2019-04-21 15:04:14 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2019-04-21 15:04:14 +0300 |
commit | dfb4f3b18cc0490cf1db9dad021fce62a99443b5 (patch) | |
tree | 73521ae6691edc38c503a20725135a7a7ac95d93 /msg.c | |
parent | 3ee06fa46236117ccb00fe4e832e7a7e4694f7f8 (diff) | |
parent | 847657fa4ec580658371d6fcaea547f7769fb569 (diff) | |
download | egawk-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.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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 |