summaryrefslogtreecommitdiff
path: root/Src/exec.c
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2016-08-04 15:53:27 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2016-08-05 12:37:26 +0000
commitf026a4dc12d93518fded8df4f14fb3161ab1db98 (patch)
tree8c8d00032bc213014490ff0b42b3194669987cc0 /Src/exec.c
parentdd6f79759fee9128bd99eff939655c34a1eb2813 (diff)
downloadzsh-f026a4dc12d93518fded8df4f14fb3161ab1db98.tar.gz
zsh-f026a4dc12d93518fded8df4f14fb3161ab1db98.zip
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.
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c3
1 files changed, 2 insertions, 1 deletions
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;