Changeset 21077 in vbox for trunk/src/VBox/Main/MachineImpl.cpp
- Timestamp:
- Jun 30, 2009 3:19:12 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/MachineImpl.cpp
r21073 r21077 3450 3450 AssertReturn (!mData->mConfigFileFull.isNull(), VERR_GENERAL_FAILURE); 3451 3451 3452 Utf8Str s trSettingsDir = mData->mConfigFileFull;3453 3454 strSettingsDir.stripFilename();3455 char folder [RTPATH_MAX];3456 int vrc = RTPathAbsEx (strSettingsDir, aPath, folder, sizeof(folder));3457 if (RT_SUCCESS (vrc))3452 Utf8Str settingsDir = mData->mConfigFileFull; 3453 3454 RTPathStripFilename (settingsDir.mutableRaw()); 3455 char folder [RTPATH_MAX]; 3456 int vrc = RTPathAbsEx (settingsDir, aPath, folder, sizeof (folder)); 3457 if (RT_SUCCESS (vrc)) 3458 3458 aResult = folder; 3459 3459 … … 3483 3483 Utf8Str settingsDir = mData->mConfigFileFull; 3484 3484 3485 settingsDir.stripFilename();3486 if (RTPathStartsWith (aPath, settingsDir))3485 RTPathStripFilename (settingsDir.mutableRaw()); 3486 if (RTPathStartsWith (aPath, settingsDir)) 3487 3487 { 3488 3488 /* when assigning, we create a separate Utf8Str instance because both … … 3491 3491 * first, and since its the same as aPath, an attempt to copy garbage 3492 3492 * will be made. */ 3493 aResult = Utf8Str (aPath + settingsDir.length() + 1);3493 aResult = Utf8Str (aPath + settingsDir.length() + 1); 3494 3494 } 3495 3495 } … … 5949 5949 /* first, rename the directory if it matches the machine name */ 5950 5950 configDir = configFile; 5951 configDir.stripFilename();5951 RTPathStripFilename (configDir.mutableRaw()); 5952 5952 newConfigDir = configDir; 5953 if (RTPathFilename (configDir) == name)5953 if (RTPathFilename (configDir) == name) 5954 5954 { 5955 newConfigDir.stripFilename();5955 RTPathStripFilename (newConfigDir.mutableRaw()); 5956 5956 newConfigDir = Utf8StrFmt ("%s%c%s", 5957 5957 newConfigDir.raw(), RTPATH_DELIMITER, newName.raw()); … … 6078 6078 6079 6079 /* ensure the settings directory exists */ 6080 Utf8Str path (mData->mConfigFileFull);6081 path.stripFilename();6082 if (!RTDirExists (path))6083 { 6084 vrc = RTDirCreateFullPath (path, 0777);6085 if (RT_FAILURE (vrc))6080 Utf8Str path = mData->mConfigFileFull; 6081 RTPathStripFilename (path.mutableRaw()); 6082 if (!RTDirExists (path)) 6083 { 6084 vrc = RTDirCreateFullPath (path, 0777); 6085 if (RT_FAILURE (vrc)) 6086 6086 { 6087 6087 return setError (E_FAIL, … … 7655 7655 * @note Not thread safe (must be called from this object's lock). 7656 7656 */ 7657 bool Machine::isInOwnDir (Utf8Str *aSettingsDir /* = NULL */)7657 bool Machine::isInOwnDir (Utf8Str *aSettingsDir /* = NULL */) 7658 7658 { 7659 7659 Utf8Str settingsDir = mData->mConfigFileFull; 7660 settingsDir.stripFilename();7661 char *dirName = RTPathFilename (settingsDir);7660 RTPathStripFilename (settingsDir.mutableRaw()); 7661 char *dirName = RTPathFilename (settingsDir); 7662 7662 7663 7663 AssertReturn (dirName, false);
Note:
See TracChangeset
for help on using the changeset viewer.