Changeset 42978 in vbox for trunk/src/VBox/Runtime/common/path/comparepaths.cpp
- Timestamp:
- Aug 24, 2012 2:01:48 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/path/comparepaths.cpp
r33540 r42978 158 158 * @param pszParentPath Parent path, must be an absolute path. 159 159 * No trailing directory slash! 160 *161 * @remarks This API doesn't currently handle root directory compares in a162 * manner consistent with the other APIs. RTPathStartsWith(pszSomePath,163 * "/") will not work if pszSomePath isn't "/".164 160 */ 165 161 RTDECL(bool) RTPathStartsWith(const char *pszPath, const char *pszParentPath) … … 174 170 175 171 const size_t cchParentPath = strlen(pszParentPath); 176 return RTPATH_IS_SLASH(pszPath[cchParentPath]) 177 || pszPath[cchParentPath] == '\0'; 172 if (RTPATH_IS_SLASH(pszPath[cchParentPath])) 173 return true; 174 if (pszPath[cchParentPath] == '\0') 175 return true; 176 177 /* Deal with pszParentPath = root (or having a trailing slash). */ 178 if ( pszParentPath > 0 179 && RTPATH_IS_SLASH(pszParentPath[cchParentPath - 1]) 180 && RTPATH_IS_SLASH(pszPath[cchParentPath - 1])) 181 return true; 182 183 return false; 178 184 } 179 185
Note:
See TracChangeset
for help on using the changeset viewer.