about summary refs log tree commit diff
path: root/Src/glob.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@users.sourceforge.net>2005-08-15 16:04:32 +0000
committerWayne Davison <wayned@users.sourceforge.net>2005-08-15 16:04:32 +0000
commited370a901abbe8180d1f852158f405c2ad87a68c (patch)
treebdb4cd90aa93b6a38b1ffd3c24ce619a87e0a19a /Src/glob.c
parent8b3558c5ed7a042c212296650eb5d452e2444395 (diff)
downloadzsh-ed370a901abbe8180d1f852158f405c2ad87a68c.tar.gz
zsh-ed370a901abbe8180d1f852158f405c2ad87a68c.tar.xz
zsh-ed370a901abbe8180d1f852158f405c2ad87a68c.zip
21609: fixed a readlink() call in statfullpath().
Diffstat (limited to 'Src/glob.c')
-rw-r--r--Src/glob.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Src/glob.c b/Src/glob.c
index 54bb98f08..723745774 100644
--- a/Src/glob.c
+++ b/Src/glob.c
@@ -259,8 +259,10 @@ statfullpath(const char *s, struct stat *st, int l)
 	l = 0;
     }
     unmetafy(buf, NULL);
-    if (!st)
-	return access(buf, F_OK) && (!l || readlink(buf, NULL, 0));
+    if (!st) {
+	char lbuf[1];
+	return access(buf, F_OK) && (!l || readlink(buf, lbuf, 1) < 0);
+    }
     return l ? lstat(buf, st) : stat(buf, st);
 }