VirtualBox

Ignore:
Timestamp:
Jun 30, 2009 3:19:12 PM (15 years ago)
Author:
vboxsync
Message:

back out r49329, r49331, will start over

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/MachineImpl.cpp

    r21073 r21077  
    34503450    AssertReturn (!mData->mConfigFileFull.isNull(), VERR_GENERAL_FAILURE);
    34513451
    3452     Utf8Str strSettingsDir = 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))
    34583458        aResult = folder;
    34593459
     
    34833483    Utf8Str settingsDir = mData->mConfigFileFull;
    34843484
    3485     settingsDir.stripFilename();
    3486     if (RTPathStartsWith(aPath, settingsDir))
     3485    RTPathStripFilename (settingsDir.mutableRaw());
     3486    if (RTPathStartsWith (aPath, settingsDir))
    34873487    {
    34883488        /* when assigning, we create a separate Utf8Str instance because both
     
    34913491         * first, and since its the same as aPath, an attempt to copy garbage
    34923492         * will be made. */
    3493         aResult = Utf8Str(aPath + settingsDir.length() + 1);
     3493        aResult = Utf8Str (aPath + settingsDir.length() + 1);
    34943494    }
    34953495}
     
    59495949            /* first, rename the directory if it matches the machine name */
    59505950            configDir = configFile;
    5951             configDir.stripFilename();
     5951            RTPathStripFilename (configDir.mutableRaw());
    59525952            newConfigDir = configDir;
    5953             if (RTPathFilename(configDir) == name)
     5953            if (RTPathFilename (configDir) == name)
    59545954            {
    5955                 newConfigDir.stripFilename();
     5955                RTPathStripFilename (newConfigDir.mutableRaw());
    59565956                newConfigDir = Utf8StrFmt ("%s%c%s",
    59575957                    newConfigDir.raw(), RTPATH_DELIMITER, newName.raw());
     
    60786078
    60796079        /* 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))
    60866086            {
    60876087                return setError (E_FAIL,
     
    76557655 *  @note Not thread safe (must be called from this object's lock).
    76567656 */
    7657 bool Machine::isInOwnDir(Utf8Str *aSettingsDir /* = NULL */)
     7657bool Machine::isInOwnDir (Utf8Str *aSettingsDir /* = NULL */)
    76587658{
    76597659    Utf8Str settingsDir = mData->mConfigFileFull;
    7660     settingsDir.stripFilename();
    7661     char *dirName = RTPathFilename(settingsDir);
     7660    RTPathStripFilename (settingsDir.mutableRaw());
     7661    char *dirName = RTPathFilename (settingsDir);
    76627662
    76637663    AssertReturn (dirName, false);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette