summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-06-15 10:24:38 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-06-15 10:24:38 +0000
commit7297827ec660e4a15059e7d31dc18697d85ae217 (patch)
treea03690b709f013433f6fba6bebaf3cb65ca4c3b2 /dir.c
parent42c59aa31785793dd365c70bac10d807c0329a34 (diff)
* dir.c (glob_helper): Use lstat() instead of stat() so it catches
a dead symlink. Given a dead symlink named "a", Dir.glob("?") did catch it but Dir.glob("a") somehow didn't. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/dir.c b/dir.c
index 3df0c0c54a..5f6e707a81 100644
--- a/dir.c
+++ b/dir.c
@@ -671,7 +671,7 @@ glob_helper(path, sub, flags, func, arg)
#else
if (!(flags & FNM_NOESCAPE)) remove_backslashes(p);
#endif
- if (stat(path, &st) == 0) {
+ if (lstat(path, &st) == 0) {
(*func)(path, arg);
}
else if (errno != ENOENT) {