summaryrefslogtreecommitdiff
path: root/win32/win32.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-26 14:12:43 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-26 14:12:43 +0000
commit14ae6199bf57b8da4043e656c11d322d9311389e (patch)
treef04ec676ad40fde81b941243b762280833b1647f /win32/win32.c
parente0cc69b74e99dd1f8ce4d9b92c255a2205fefaa4 (diff)
win32.c: fix for old platforms
* win32/win32.c (open_dir_handle): fix for old platforms where GetFinalPathNameByHandleW is not supported. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32/win32.c')
-rw-r--r--win32/win32.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 157d43e..47e35ca 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -1860,7 +1860,7 @@ open_dir_handle(const WCHAR *filename, WIN32_FIND_DATAW *fd)
WCHAR fullname[MAX_PATH];
WCHAR *scanname;
WCHAR *p;
- int len;
+ int len = 0;
VALUE v;
//
@@ -1872,6 +1872,8 @@ open_dir_handle(const WCHAR *filename, WIN32_FIND_DATAW *fd)
if (fh != INVALID_HANDLE_VALUE) {
len = get_final_path(fh, fullname, numberof(fullname), 0);
CloseHandle(fh);
+ }
+ if (len) {
filename = fullname;
}
else {