diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | win32/win32.c | 2 |
2 files changed, 8 insertions, 1 deletions
@@ -1,3 +1,10 @@ +Thu Jan 5 15:26:15 2012 NAKAMURA Usaku <usa@ruby-lang.org> + + * 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 <naruse@ruby-lang.org> * 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); |