mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 04:55:21 +02:00
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
This commit is contained in:
parent
28a7199ae0
commit
1664a4ca03
1 changed files with 1 additions and 1 deletions
|
@ -1931,7 +1931,6 @@ opendir_internal(WCHAR *wpath, const char *filename)
|
||||||
if (wstati64(wpath, &sbuf) < 0) {
|
if (wstati64(wpath, &sbuf) < 0) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
pathlen = lstrlenW(wpath);
|
|
||||||
if (!(sbuf.st_mode & S_IFDIR) &&
|
if (!(sbuf.st_mode & S_IFDIR) &&
|
||||||
(!ISALPHA(filename[0]) || filename[1] != ':' || filename[2] != '\0' ||
|
(!ISALPHA(filename[0]) || filename[1] != ':' || filename[2] != '\0' ||
|
||||||
((1 << ((filename[0] & 0x5f) - 'A')) & GetLogicalDrives()) == 0)) {
|
((1 << ((filename[0] & 0x5f) - 'A')) & GetLogicalDrives()) == 0)) {
|
||||||
|
@ -1950,6 +1949,7 @@ opendir_internal(WCHAR *wpath, const char *filename)
|
||||||
if (p == NULL)
|
if (p == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
pathlen = lstrlenW(wpath);
|
||||||
idx = 0;
|
idx = 0;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue