diff options
Diffstat (limited to 'drivers/windows/dir_access_windows.cpp')
-rw-r--r-- | drivers/windows/dir_access_windows.cpp | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/drivers/windows/dir_access_windows.cpp b/drivers/windows/dir_access_windows.cpp index 8ac4e53c65..9eac15f774 100644 --- a/drivers/windows/dir_access_windows.cpp +++ b/drivers/windows/dir_access_windows.cpp @@ -347,27 +347,26 @@ size_t DirAccessWindows::get_space_left() { } String DirAccessWindows::get_filesystem_type() const { - String path = fix_path(const_cast<DirAccessWindows*>(this)->get_current_dir()); - print_line("fixed path: "+path); + String path = fix_path(const_cast<DirAccessWindows *>(this)->get_current_dir()); + int unit_end = path.find(":"); - ERR_FAIL_COND_V(unit_end==-1,String()); - String unit = path.substr(0,unit_end+1) + "\\"; - print_line("unit: "+unit); + ERR_FAIL_COND_V(unit_end == -1, String()); + String unit = path.substr(0, unit_end + 1) + "\\"; WCHAR szVolumeName[100]; WCHAR szFileSystemName[10]; - DWORD dwSerialNumber = 0; - DWORD dwMaxFileNameLength = 0; - DWORD dwFileSystemFlags = 0; - - if(::GetVolumeInformationW(unit.c_str(), - szVolumeName, - sizeof(szVolumeName), - &dwSerialNumber, - &dwMaxFileNameLength, - &dwFileSystemFlags, - szFileSystemName, - sizeof(szFileSystemName)) == TRUE) { + DWORD dwSerialNumber = 0; + DWORD dwMaxFileNameLength = 0; + DWORD dwFileSystemFlags = 0; + + if (::GetVolumeInformationW(unit.c_str(), + szVolumeName, + sizeof(szVolumeName), + &dwSerialNumber, + &dwMaxFileNameLength, + &dwFileSystemFlags, + szFileSystemName, + sizeof(szFileSystemName)) == TRUE) { return String(szFileSystemName); } @@ -395,7 +394,7 @@ DirAccessWindows::DirAccessWindows() { if (mask & (1 << i)) { //DRIVE EXISTS - drives[drive_count] = 'a' + i; + drives[drive_count] = 'A' + i; drive_count++; } } |