diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | Src/exec.c | 3 | ||||
-rw-r--r-- | Test/C04funcdef.ztst | 10 |
3 files changed, 15 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog index 71d4052fb..dc06dbe50 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2016-08-05 Daniel Shahaf <d.s@daniel.shahaf.name> + * 38991: Src/exec.c, Test/C04funcdef.ztst: Make 'whence -v + autoloaded-function' shows the defining filename. + * 38990: Completion/Debian/Type/_debbugs_bugnumber: Track bts's data dir migration. 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; diff --git a/Test/C04funcdef.ztst b/Test/C04funcdef.ztst index 496577f6c..9f15e04ff 100644 --- a/Test/C04funcdef.ztst +++ b/Test/C04funcdef.ztst @@ -321,6 +321,16 @@ > print oops was successfully autoloaded >} + ( + fpath=(.) + printf '%s\n' 'oops(){}' 'ninjas-earring(){}' 'oops "$@"' >oops + autoload oops + oops + whence -v oops + ) +0:whence -v of zsh-style autoload +>oops is a shell function from ./oops + %clean rm -f file.in file.out |