about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/Modules/stat.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 23b4177c2..3029a8824 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-11-02  Andrey Borzenkov  <bor@zsh.org>
+
+	* 21978: Src/Modules/stat.c: unmetafy file name before calling
+	sysem (l)stat
+
 2005-11-02  Peter Stephenson  <pws@csr.com>
 
 	* 21974: Src/params.c: memory leak with tied parameters.
diff --git a/Src/Modules/stat.c b/Src/Modules/stat.c
index 9f3d4a6de..188b37fc7 100644
--- a/Src/Modules/stat.c
+++ b/Src/Modules/stat.c
@@ -532,8 +532,8 @@ bin_stat(char *name, char **args, Options ops, UNUSED(int func))
     for (; OPT_ISSET(ops,'f') || *args; args++) {
 	char outbuf[PATH_MAX + 9]; /* "link   " + link name + NULL */
 	int rval = OPT_ISSET(ops,'f') ? fstat(fd, &statbuf) :
-	    OPT_ISSET(ops,'L') ? lstat(*args, &statbuf) :
-	    stat(*args, &statbuf);
+	    OPT_ISSET(ops,'L') ? lstat(unmeta(*args), &statbuf) :
+	    stat(unmeta(*args), &statbuf);
 	if (rval) {
 	    if (OPT_ISSET(ops,'f'))
 		sprintf(outbuf, "%d", fd);