[前][次][番号順一覧][スレッド一覧]

ruby-changes:22167

From: usa <ko1@a...>
Date: Thu, 5 Jan 2012 15:29:45 +0900 (JST)
Subject: [ruby-changes:22167] usa:r34216 (trunk): * win32/win32.c (check_valid_dir): strict checking of root.

usa	2012-01-05 15:29:31 +0900 (Thu, 05 Jan 2012)

  New Revision: 34216

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=34216

  Log:
    * 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.

  Modified files:
    trunk/ChangeLog
    trunk/win32/win32.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 34215)
+++ ChangeLog	(revision 34216)
@@ -1,3 +1,10 @@
+Thu Jan  5 15:26:15 2012  NAKAMURA Usaku  <usa@r...>
+
+	* 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@r...>
 
 	* file.c (rb_file_join): separator is appended by array length - 1
Index: win32/win32.c
===================================================================
--- win32/win32.c	(revision 34215)
+++ win32/win32.c	(revision 34216)
@@ -4485,7 +4485,7 @@
 	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);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]