From 8879836ca92ac70d32740dfd7d0869b83b8e0f41 Mon Sep 17 00:00:00 2001 From: knu Date: Sat, 15 Jun 2002 10:24:38 +0000 Subject: * 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: http://svn.ruby-lang.org/repos/ruby/trunk@2571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ dir.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3949c5d75..01efb4d95 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sat Jun 15 18:51:13 2002 Akinori MUSHA + + * 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. + Fri Jun 14 21:01:48 2002 KONISHI Hiromasa * bcc32/mkexports.rb: insert sleep(1) for win9x. diff --git a/dir.c b/dir.c index 3df0c0c54..5f6e707a8 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) { -- cgit