aboutsummaryrefslogtreecommitdiffstats
path: root/win32
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-01 15:06:17 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-01 15:06:17 +0000
commit0f19e79b87b094353f2227c95ed64329fadb21e2 (patch)
tree66c8891f32496ec574ca62627807fc7eb8003783 /win32
parenta82fb030b73c8f2d70fbc8d85273d94be253eed3 (diff)
downloadruby-0f19e79b87b094353f2227c95ed64329fadb21e2.tar.gz
win32.c: w32_wopendir
* win32/win32.c (w32_wopendir): remove filename parameter, and check the drive letter in wpath instead. rename from opendir_internal. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 9b069e588d..39ff7495d6 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -1912,7 +1912,7 @@ open_dir_handle(const WCHAR *filename, WIN32_FIND_DATAW *fd)
/* License: Artistic or GPL */
static DIR *
-opendir_internal(WCHAR *wpath, const char *filename)
+w32_wopendir(const WCHAR *wpath)
{
struct stati64 sbuf;
WIN32_FIND_DATAW fd;
@@ -1932,8 +1932,8 @@ opendir_internal(WCHAR *wpath, const char *filename)
return NULL;
}
if (!(sbuf.st_mode & S_IFDIR) &&
- (!ISALPHA(filename[0]) || filename[1] != ':' || filename[2] != '\0' ||
- ((1 << ((filename[0] & 0x5f) - 'A')) & GetLogicalDrives()) == 0)) {
+ (!ISALPHA(wpath[0]) || wpath[1] != L':' || wpath[2] != L'\0' ||
+ ((1 << ((wpath[0] & 0x5f) - 'A')) & GetLogicalDrives()) == 0)) {
errno = ENOTDIR;
return NULL;
}
@@ -2055,7 +2055,7 @@ rb_w32_opendir(const char *filename)
WCHAR *wpath = filecp_to_wstr(filename, NULL);
if (!wpath)
return NULL;
- ret = opendir_internal(wpath, filename);
+ ret = w32_wopendir(wpath);
free(wpath);
return ret;
}
@@ -2068,7 +2068,7 @@ rb_w32_uopendir(const char *filename)
WCHAR *wpath = utf8_to_wstr(filename, NULL);
if (!wpath)
return NULL;
- ret = opendir_internal(wpath, filename);
+ ret = w32_wopendir(wpath);
free(wpath);
return ret;
}