about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPaul Ackersviller <packersv@users.sourceforge.net>2007-06-12 01:37:39 +0000
committerPaul Ackersviller <packersv@users.sourceforge.net>2007-06-12 01:37:39 +0000
commit2c718e9f126f7ff0d2f417b288669f988f6ba7e4 (patch)
tree9b9643dde94a739e0e582d4182625d2a6670afbd
parent6f99bd559b1c80051779b234ecc8f6cfa3d117b9 (diff)
downloadzsh-2c718e9f126f7ff0d2f417b288669f988f6ba7e4.tar.gz
zsh-2c718e9f126f7ff0d2f417b288669f988f6ba7e4.tar.xz
zsh-2c718e9f126f7ff0d2f417b288669f988f6ba7e4.zip
Merge of 21609: fixed the readlink() call in statfullpath().
-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);
 }