VirtualBox

Changeset 61645 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Jun 10, 2016 7:56:48 AM (9 years ago)
Author:
vboxsync
Message:

bugref:8344. added logic when new location consists of only a filename without extension.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/MediumImpl.cpp

    r61604 r61645  
    29972997            {
    29982998                /*
    2999                  * small trick. This case means target path has no filename at the end
    3000                  * it will look like "/path/to/new/location"
     2999                 * small trick. This case means target path has no filename at the end.
     3000                 * it will look like "/path/to/new/location" or just "newname"
    30013001                 * there is no backslash in the end
    3002                  * and there is no filename with extension(suffix) in the end
     3002                 * or there is no filename with extension(suffix) in the end
     3003                 */
     3004
     3005                /* case when new path contains only "newname", no path, no extension */
     3006                if (destMediumPath.equals(destMediumFileName))
     3007                {
     3008                    Utf8Str localSuffix = RTPathSuffix(sourceMediumFileName.c_str());
     3009                    destMediumFileName.append(localSuffix);
     3010                    destMediumPath = destMediumFileName;
     3011                }
     3012                /* case when new path looks like "/path/to/new/location"
    30033013                 * In this case just set destMediumFileName to NULL and
    3004                  * and add '/' in the end of path.destMediumPath
    3005                  */
    3006                 destMediumFileName.setNull();
    3007                 destMediumPath.append(RTPATH_SLASH);
     3014                 * and add '/' in the end of path.destMediumPath
     3015                 */
     3016                else
     3017                {
     3018                    destMediumFileName.setNull();
     3019                    destMediumPath.append(RTPATH_SLASH);
     3020                }
    30083021            }
    30093022
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