From ed370a901abbe8180d1f852158f405c2ad87a68c Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Mon, 15 Aug 2005 16:04:32 +0000 Subject: 21609: fixed a readlink() call in statfullpath(). --- Src/glob.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Src/glob.c') 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