summary refs log tree commit diff
path: root/Src/signals.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2017-01-16 10:31:56 +0000
committerPeter Stephenson <pws@zsh.org>2017-01-16 10:31:56 +0000
commitf90a0447aada3ad2fa114210c62b855a3e60cb1d (patch)
treef1756619779fb93985c53fc2a39cf313f2e130c5 /Src/signals.c
parentebd7fdd9326cf36feda3b0ca906d7b9b8bf79cb5 (diff)
downloadzsh-f90a0447aada3ad2fa114210c62b855a3e60cb1d.tar.gz
zsh-f90a0447aada3ad2fa114210c62b855a3e60cb1d.tar.xz
zsh-f90a0447aada3ad2fa114210c62b855a3e60cb1d.zip
40353 with tweaks to whence -v: extend directory cache use.
Now used for all autoloaded functions after load, including those
where the file was found along fpath, reducing duplication of
directory names.
Diffstat (limited to 'Src/signals.c')
-rw-r--r--Src/signals.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/Src/signals.c b/Src/signals.c
index 2de57434a..a7176771a 100644
--- a/Src/signals.c
+++ b/Src/signals.c
@@ -811,8 +811,11 @@ dosavetrap(int sig, int level)
 	    newshf->node.nam = ztrdup(shf->node.nam);
 	    newshf->node.flags = shf->node.flags;
 	    newshf->funcdef = dupeprog(shf->funcdef, 0);
-	    /* Assume this is a real filename, don't use dircache */
-	    newshf->filename = ztrdup(shf->filename);
+	    if (shf->node.flags & PM_LOADDIR) {
+		dircache_set(&newshf->filename, shf->filename);
+	    } else {
+		newshf->filename = ztrdup(shf->filename);
+	    }
 	    if (shf->sticky) {
 		newshf->sticky = sticky_emulation_dup(shf->sticky, 0);
 	    } else