From 34f70c5dc08bbecd20fbb8a1797851103fbad45e Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Sat, 28 Jan 2017 19:33:27 +0000 Subject: 40440: Add $functions_source hash to zsh/parameter. This allows you to find out where a function was loaded from. --- Src/hashtable.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Src/hashtable.c') diff --git a/Src/hashtable.c b/Src/hashtable.c index 1f2789d07..8987c8597 100644 --- a/Src/hashtable.c +++ b/Src/hashtable.c @@ -1565,6 +1565,15 @@ dircache_set(char **name, char *value) zsfree(*name); *name = NULL; } else { + /* + * As the function path has been resolved to a particular + * location, we'll store it as an absolute path. + */ + if (*value != '/') { + value = zhtricat(metafy(zgetcwd(), -1, META_HEAPDUP), + "/", value); + value = xsymlink(value, 1); + } /* * We'll maintain the cache at exactly the right size rather * than overallocating. The rationale here is that typically -- cgit v1.2.3