diff options
-rw-r--r-- | Src/glob.c | 6 |
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); } |