summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-01 06:25:21 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-01 06:25:21 +0000
commit1664a4ca03a76fdbb0ecaeb2aa8e42ddb5fbf36c (patch)
treec66e709bd28046a7dbf9d66d37d22c774432d17d
parent28a7199ae03b98093b60f87d4666e4e928bb0f1e (diff)
win32.c: move counting length
* win32/win32.c (opendir_internal): defer counting the length just before the loop where it is used. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--win32/win32.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 47408e0375..a4706f4ac8 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -1931,7 +1931,6 @@ opendir_internal(WCHAR *wpath, const char *filename)
if (wstati64(wpath, &sbuf) < 0) {
return NULL;
}
- pathlen = lstrlenW(wpath);
if (!(sbuf.st_mode & S_IFDIR) &&
(!ISALPHA(filename[0]) || filename[1] != ':' || filename[2] != '\0' ||
((1 << ((filename[0] & 0x5f) - 'A')) & GetLogicalDrives()) == 0)) {
@@ -1950,6 +1949,7 @@ opendir_internal(WCHAR *wpath, const char *filename)
if (p == NULL)
return NULL;
+ pathlen = lstrlenW(wpath);
idx = 0;
//