Changeset 15809 in vbox for trunk/src/VBox/Runtime/r3/win
- Timestamp:
- Jan 5, 2009 3:49:05 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/win/path-win.cpp
r15808 r15809 122 122 rc = GetFullPathNameW(pwszPath, RT_ELEMENTS(wsz), &wsz[0], &pwszFile); 123 123 if (rc > 0 && rc < RT_ELEMENTS(wsz)) 124 rc = RTUtf16ToUtf8Ex(&wsz[0], RTSTR_MAX, &pszAbsPath, cchAbsPath, NULL); 124 { 125 size_t cch; 126 rc = RTUtf16ToUtf8Ex(&wsz[0], RTSTR_MAX, &pszAbsPath, cchAbsPath, &cch); 127 if (RT_SUCCESS(rc)) 128 { 129 /* 130 * Remove trailing slash if the path may be pointing to a directory. 131 * (See posix variant.) 132 */ 133 if ( cch > 1 134 && RTPATH_IS_SLASH(pszAbsPath[cch - 1]) 135 && !RTPATH_IS_VOLSEP(pszAbsPath[cch - 2]) 136 && !RTPATH_IS_SLASH(pszAbsPath[cch - 2])) 137 pszAbsPath[cch - 1] = '\0'; 138 } 139 } 125 140 else if (rc <= 0) 126 141 rc = RTErrConvertFromWin32(GetLastError()); … … 129 144 130 145 RTUtf16Free(pwszPath); 131 132 if (RT_SUCCESS(rc))133 {134 /*135 * Remove trailing slash if the path may be pointing to a directory.136 */137 size_t cch = strlen(pszAbsPath);138 if ( cch > 1139 && RTPATH_IS_SLASH(pszAbsPath[cch - 1])140 && !RTPATH_IS_VOLSEP(pszAbsPath[cch - 2])141 && !RTPATH_IS_SLASH(pszAbsPath[cch - 2]))142 pszAbsPath[cch - 1] = '\0';143 }144 145 146 return rc; 146 147 }
Note:
See TracChangeset
for help on using the changeset viewer.