Changeset 78104 in vbox
- Timestamp:
- Apr 10, 2019 5:33:18 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 129960
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/path.h
r78098 r78104 365 365 * Same as RTPathAbsEx only the result is RTStrDup()'ed. 366 366 * 367 * @returns Pointer to the absolute path. Use RTStrFree() to free this string. 368 * @returns NULL if RTPathAbsEx() or RTStrDup() fails. 367 * @returns Pointer to the absolute path. Use RTStrFree() to free this string. 368 * @retval NULL if RTPathAbsEx() or RTStrDup() fails. 369 * 369 370 * @param pszBase The base path to act like a current directory. 370 371 * When NULL, the actual cwd is used (i.e. the call 371 372 * is equivalent to RTPathAbs(pszPath, ...). 372 373 * @param pszPath The path to resolve. 373 * 374 * @note Current implementation is buggy and will remove trailing slashes375 * that would normally specify a directory. Don't depend on this.376 */ 377 RTDECL(char *) RTPathAbsExDup(const char *pszBase, const char *pszPath );374 * @param fFlags One of the RTPATH_STR_F_STYLE_XXX flags combined 375 * with any of the RTPATHABS_F_XXX ones. Most 376 * users will pass RTPATH_STR_F_STYLE_HOST (0). 377 */ 378 RTDECL(char *) RTPathAbsExDup(const char *pszBase, const char *pszPath, uint32_t fFlags); 378 379 379 380 /** -
trunk/src/VBox/Devices/Network/slirp/tftp.c
r76783 r78104 142 142 else 143 143 { 144 char *pszFullPathAbs = RTPathAbsExDup(tftp_prefix, (const char *)pcTftpSession->pszFilename);144 char *pszFullPathAbs = RTPathAbsExDup(tftp_prefix, (const char *)pcTftpSession->pszFilename, RTPATH_STR_F_STYLE_HOST); 145 145 146 146 if ( !pszFullPathAbs -
trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp
r78102 r78104 19 19 #include <iprt/alloca.h> 20 20 #include <iprt/path.h> 21 #include <iprt/cpp/path.h> 21 22 #include <iprt/dir.h> 22 23 #include <iprt/file.h> … … 2394 2395 * @param pTargetMedium out: The newly created target medium. This also gets pushed on stack.llHardDisksCreated for cleanup. 2395 2396 * @param stack 2397 * 2398 * @throws HRESULT 2396 2399 */ 2397 2400 void Appliance::i_importOneDiskImage(const ovf::DiskImage &di, … … 2401 2404 { 2402 2405 HRESULT rc; 2403 char *pszAbsDstPath = RTPathAbsExDup(stack.strMachineFolder.c_str(), 2404 strDstPath.c_str()); 2405 Utf8Str strAbsDstPath(pszAbsDstPath); 2406 RTStrFree(pszAbsDstPath); 2407 pszAbsDstPath = NULL; 2406 2407 Utf8Str strAbsDstPath; 2408 int vrc = RTPathAbsExCxx(strAbsDstPath, stack.strMachineFolder, strDstPath); 2409 AssertRCStmt(vrc, throw Global::vboxStatusCodeToCOM(vrc)); 2408 2410 2409 2411 /* Get the system properties. */ … … 2432 2434 * the current code can't possibly handle. */ 2433 2435 RTUUID uuid; 2434 intvrc = RTUuidFromStr(&uuid, strDstPath.c_str());2436 vrc = RTUuidFromStr(&uuid, strDstPath.c_str()); 2435 2437 if (vrc == VINF_SUCCESS) 2436 2438 { -
trunk/src/VBox/Runtime/common/path/RTPathAbsExDup.cpp
r78098 r78104 37 37 38 38 39 /** 40 * Same as RTPathAbsEx only the result is RTStrDup()'ed. 41 * 42 * @returns Pointer to the absolute path. Use RTStrFree() to free this string. 43 * @returns NULL if RTPathAbsEx() or RTStrDup() fails. 44 * @param pszBase The base path to act like a current directory. 45 * When NULL, the actual cwd is used (i.e. the call 46 * is equivalent to RTPathAbs(pszPath, ...). 47 * @param pszPath The path to resolve. 48 */ 49 RTDECL(char *) RTPathAbsExDup(const char *pszBase, const char *pszPath) 39 RTDECL(char *) RTPathAbsExDup(const char *pszBase, const char *pszPath, uint32_t fFlags) 50 40 { 51 41 char szPath[RTPATH_MAX]; 52 42 size_t cbPath = sizeof(szPath); 53 int rc = RTPathAbsEx(pszBase, pszPath, RTPATH_STR_F_STYLE_HOST, szPath, &cbPath);43 int rc = RTPathAbsEx(pszBase, pszPath, fFlags, szPath, &cbPath); 54 44 if (RT_SUCCESS(rc)) 55 45 return RTStrDup(szPath); … … 58 48 { 59 49 size_t cbPrevPath = sizeof(szPath); 60 uint32_t cTries = 6;50 uint32_t cTries = 8; 61 51 while (cTries-- > 0) 62 52 { … … 66 56 if (pszAbsPath) 67 57 { 68 rc = RTPathAbsEx(pszBase, pszPath, RTPATH_STR_F_STYLE_HOST, pszAbsPath, &cbPath);58 rc = RTPathAbsEx(pszBase, pszPath, fFlags, pszAbsPath, &cbPath); 69 59 if (RT_SUCCESS(rc)) 70 60 return pszAbsPath; -
trunk/src/bldprogs/scm.cpp
r76587 r78104 1105 1105 if (pszDir) 1106 1106 { 1107 pSettings->pszGuardRelativeToDir = RTPathAbsExDup(pszDir, pValueUnion->psz );1107 pSettings->pszGuardRelativeToDir = RTPathAbsExDup(pszDir, pValueUnion->psz, RTPATH_STR_F_STYLE_HOST); 1108 1108 RTStrFree(pszDir); 1109 1109 if (pSettings->pszGuardRelativeToDir)
Note:
See TracChangeset
for help on using the changeset viewer.