From f026a4dc12d93518fded8df4f14fb3161ab1db98 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Thu, 4 Aug 2016 15:53:27 +0000 Subject: 38991: Make 'whence -v autoloaded-function' shows the defining filename. This may also fix a problem whereby the %x prompt escape evaluated to a function name rather than a filename, since %x is also backed by scriptfilename. --- Src/exec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Src/exec.c') diff --git a/Src/exec.c b/Src/exec.c index 515406f33..ea9214d04 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -4915,7 +4915,8 @@ execautofn_basic(Estate state, UNUSED(int do_exec)) oldscriptname = scriptname; oldscriptfilename = scriptfilename; - scriptname = scriptfilename = dupstring(shf->node.nam); + scriptname = dupstring(shf->node.nam); + scriptfilename = dupstring(shf->filename); execode(shf->funcdef, 1, 0, "loadautofunc"); scriptname = oldscriptname; scriptfilename = oldscriptfilename; -- cgit 1.4.1