- Timestamp:
- May 29, 2017 5:51:35 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
include/iprt/err.h (modified) (1 diff)
-
src/VBox/Runtime/common/vfs/vfschain.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/err.h
r66762 r67133 1964 1964 * system or file system stream. */ 1965 1965 #define VERR_VFS_CHAIN_TYPE_MISMATCH_PATH_ONLY (-22156) 1966 /** VFS chain doesn't end with a path only element. */ 1967 #define VERR_VFS_CHAIN_NOT_PATH_ONLY (-22157) 1966 1968 /** @} */ 1967 1969 -
trunk/src/VBox/Runtime/common/vfs/vfschain.cpp
r66762 r67133 1491 1491 1492 1492 1493 RTDECL(int) RTVfsChainQueryFinalPath(const char *pszSpec, char **ppszFinalPath, uint32_t *poffError) 1494 { 1495 /* Make sure we've got an error info variable. */ 1496 uint32_t offErrorIgn; 1497 if (!poffError) 1498 poffError = &offErrorIgn; 1499 *poffError = 0; 1500 1501 /* 1502 * If not chain specifier, just duplicate the input and return. 1503 */ 1504 if (strncmp(pszSpec, RTVFSCHAIN_SPEC_PREFIX, sizeof(RTVFSCHAIN_SPEC_PREFIX) - 1) != 0) 1505 return RTStrDupEx(ppszFinalPath, pszSpec); 1506 1507 /* 1508 * Parse it and check out the last element. 1509 */ 1510 PRTVFSCHAINSPEC pSpec = NULL; 1511 int rc = RTVfsChainSpecParse(pszSpec, 0 /*fFlags*/, RTVFSOBJTYPE_BASE, &pSpec, poffError); 1512 if (RT_SUCCESS(rc)) 1513 { 1514 PCRTVFSCHAINELEMSPEC pLast = &pSpec->paElements[pSpec->cElements - 1]; 1515 if (pLast->pszProvider == NULL) 1516 rc = RTStrDupEx(ppszFinalPath, pLast->paArgs[0].psz); 1517 else 1518 { 1519 rc = VERR_VFS_CHAIN_NOT_PATH_ONLY; 1520 *poffError = pLast->offSpec; 1521 } 1522 RTVfsChainSpecFree(pSpec); 1523 } 1524 return rc; 1525 } 1526
Note:
See TracChangeset
for help on using the changeset viewer.

