summary refs log tree commit diff
path: root/Src/Zle
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2005-08-16 00:51:57 +0000
committerClint Adams <clint@users.sourceforge.net>2005-08-16 00:51:57 +0000
commit3c92ad4b90ac908f6ca4bb7feed2527f925d77a5 (patch)
treee42d23c6fa2c191c93412ee0e6cd8bb56a59c648 /Src/Zle
parent3073da5dbad4eaef654d262bcda1eebceb1b3a61 (diff)
downloadzsh-3c92ad4b90ac908f6ca4bb7feed2527f925d77a5.tar.gz
zsh-3c92ad4b90ac908f6ca4bb7feed2527f925d77a5.tar.xz
zsh-3c92ad4b90ac908f6ca4bb7feed2527f925d77a5.zip
21631: make sure an unmetafied string is passed to ztat to determine file type.
Diffstat (limited to 'Src/Zle')
-rw-r--r--Src/Zle/compcore.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c
index 3a86eb793..66a673dcd 100644
--- a/Src/Zle/compcore.c
+++ b/Src/Zle/compcore.c
@@ -2484,16 +2484,23 @@ add_match_data(int alt, char *str, char *orig, Cline line,
     if ((flags & CMF_FILE) && orig[0] && orig[strlen(orig) - 1] != '/') {
         struct stat buf;
         char *pb;
+	int blahl;
 
         pb = (char *) zhalloc((cm->prpre ? strlen(cm->prpre) : 0) +
                               3 + strlen(orig));
         sprintf(pb, "%s%s", (cm->prpre ? cm->prpre : "./"), orig);
 
-        if (!ztat(pb, &buf, 1)) {
+	char *blah = ztrdup(pb);
+
+	unmetafy(blah, &blahl);
+
+        if (!ztat(blah, &buf, 1)) {
             cm->mode = buf.st_mode;
             if ((cm->modec = file_type(buf.st_mode)) == ' ')
                 cm->modec = '\0';
         }
+
+	free(blah);
     }
     if ((*compqstack == '\\' && compqstack[1]) ||
 	(autoq && *compqstack && compqstack[1] == '\\'))