From cef30c7a417b1e4fa57369792201aa0625b5fceb Mon Sep 17 00:00:00 2001 From: usa Date: Thu, 5 Jan 2012 06:29:31 +0000 Subject: * win32/win32.c (check_valid_dir): strict checking of root. GetDriveType() succeeds with non root directory as the argument, even if MSDN says that the API needs the root directory. this patch fixes a failure of test/ruby/test_file_exhaustive.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ win32/win32.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7c10c31d33..803a19b867 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Thu Jan 5 15:26:15 2012 NAKAMURA Usaku + + * win32/win32.c (check_valid_dir): strict checking of root. + GetDriveType() succeeds with non root directory as the argument, + even if MSDN says that the API needs the root directory. + this patch fixes a failure of test/ruby/test_file_exhaustive.rb. + Thu Jan 5 12:15:55 2012 NARUSE, Yui * file.c (rb_file_join): separator is appended by array length - 1 diff --git a/win32/win32.c b/win32/win32.c index 62c3076d73..4804359794 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -4485,7 +4485,7 @@ check_valid_dir(const WCHAR *path) errno = map_errno(GetLastError()); return -1; } - if (GetDriveTypeW(full) != DRIVE_NO_ROOT_DIR) + if (full[1] == L':' && !full[3] && GetDriveTypeW(full) != DRIVE_NO_ROOT_DIR) return 0; fh = open_dir_handle(path, &fd); -- cgit v1.2.3