Permalink
Browse files

* 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
  • Loading branch information...
1 parent 0d8ad1a commit cef30c7a417b1e4fa57369792201aa0625b5fceb @unak unak committed Jan 5, 2012
Showing with 8 additions and 1 deletion.
  1. +7 −0 ChangeLog
  2. +1 −1 win32/win32.c
View
@@ -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
View
@@ -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);

0 comments on commit cef30c7

Please sign in to comment.