about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2007-04-27 16:04:47 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2007-04-27 16:04:47 +0000
commit4b635e7f91d0192dbb811986ae1f4eabffc43f76 (patch)
tree68923c492a853161d8a2bed8ca3bb4d544ea8391
parentcb01bab6c00ce1b7ba86a9121fabef72b3c20923 (diff)
downloadzsh-4b635e7f91d0192dbb811986ae1f4eabffc43f76.tar.gz
zsh-4b635e7f91d0192dbb811986ae1f4eabffc43f76.tar.xz
zsh-4b635e7f91d0192dbb811986ae1f4eabffc43f76.zip
23337: fix unmetafication for stat() of files in compctl
-rw-r--r--ChangeLog7
-rw-r--r--Src/Zle/compctl.c7
2 files changed, 13 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 511271ea2..82630e530 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-04-27  Peter Stephenson  <pws@csr.com>
+
+	* 23337: Src/Zle/compctl.c: argument to stat() wasn't
+	unmetafied so some filenames with non-ASCII characters
+	weren't recognised when the type of the file needed testing
+	in old-fashioned completion.
+
 2007-04-26  Peter Stephenson  <pws@csr.com>
 
 	* Phil Pennock: 23326: Src/utils.c: with no __STDC_ISO_10646__
diff --git a/Src/Zle/compctl.c b/Src/Zle/compctl.c
index 17c8083f0..81f11b423 100644
--- a/Src/Zle/compctl.c
+++ b/Src/Zle/compctl.c
@@ -2188,9 +2188,14 @@ gen_matches_files(int dirs, int execs, int all)
 		if (!test)
 		    continue;
 		if (!all) {
+		    char *ums;
+		    int umlen;
 		    /* We still have to check the file type, so prepare *
 		     * the path buffer by appending the filename.       */
-		    strcpy(q, n);
+		    ums = dupstring(n);
+		    unmetafy(ums, &umlen);
+		    memcpy(q, ums, umlen);
+		    q[umlen] = '\0';
 		    /* And do the stat. */
 		    if (stat(p, &buf) < 0)
 			continue;