From 2c718e9f126f7ff0d2f417b288669f988f6ba7e4 Mon Sep 17 00:00:00 2001 From: Paul Ackersviller Date: Tue, 12 Jun 2007 01:37:39 +0000 Subject: Merge of 21609: fixed the readlink() call in statfullpath(). --- Src/glob.c | 6 ++++-- 1 file 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); } -- cgit 1.4.1