- 時間撮記:
- 2012-8-24 下午02:01:48 (12 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
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
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器