about summary refs log tree commit diff
path: root/Src/subst.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2011-03-11 16:32:07 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2011-03-11 16:32:07 +0000
commitf2dca9e155f25ee57f15df7dc2dc81489e1abbae (patch)
tree7fcb3500f0c2c7d66b12fe3a50e92e2913d26cc7 /Src/subst.c
parentcc69ecfb9e10fca2d8f68100ff9f2365dedb1405 (diff)
downloadzsh-f2dca9e155f25ee57f15df7dc2dc81489e1abbae.tar.gz
zsh-f2dca9e155f25ee57f15df7dc2dc81489e1abbae.tar.xz
zsh-f2dca9e155f25ee57f15df7dc2dc81489e1abbae.zip
users/15864: turn zsh_directory_name into a hook
Diffstat (limited to 'Src/subst.c')
-rw-r--r--Src/subst.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/Src/subst.c b/Src/subst.c
index 37d63cabe..9b3699a47 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -579,7 +579,6 @@ filesubstr(char **namptr, int assign)
     char *str = *namptr;
 
     if (*str == Tilde && str[1] != '=' && str[1] != Equals) {
-	Shfunc dirfunc;
 	char *ptr, *tmp, *res, *ptr2;
 	int val;
 
@@ -594,12 +593,11 @@ filesubstr(char **namptr, int assign)
 	    *namptr = dyncat((tmp = oldpwd) ? tmp : pwd, str + 2);
 	    return 1;
 	} else if (str[1] == Inbrack &&
-		   (dirfunc = getshfunc("zsh_directory_name")) &&
 		   (ptr2 = strchr(str+2, Outbrack))) {
 	    char **arr;
 	    untokenize(tmp = dupstrpfx(str+2, ptr2 - (str+2)));
 	    remnulargs(tmp);
-	    arr = subst_string_by_func(dirfunc, "n", tmp);
+	    arr = subst_string_by_hook("zsh_directory_name", "n", tmp);
 	    res = arr ? *arr : NULL;
 	    if (res) {
 		*namptr = dyncat(res, ptr2+1);