VirtualBox

Changeset 61604 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jun 9, 2016 8:02:03 AM (9 years ago)
Author:
vboxsync
Message:

bugref:8344. using RTPATH_SLASH.

File:
1 edited

Legend:

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

    r61541 r61604  
    29912991            destMediumFileName.stripPath();
    29922992
     2993            Utf8Str suffix(destMediumFileName);
     2994            suffix.stripSuffix();//for small trick, see next condition
     2995
     2996            if(suffix.equals(destMediumFileName) && !destMediumFileName.isEmpty())
     2997            {
     2998                /*
     2999                 * small trick. This case means target path has no filename at the end
     3000                 * it will look like "/path/to/new/location"
     3001                 * there is no backslash in the end
     3002                 * and there is no filename with extension(suffix) in the end
     3003                 * 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);
     3008            }
     3009
    29933010            if (destMediumFileName.isEmpty())
    29943011            {
     
    30033020                     * next move medium within the source directory with the passed new name
    30043021                     */
    3005                     destMediumPath = sourceMediumPath.stripFilename().append('/').append(destMediumFileName);
     3022                    destMediumPath = sourceMediumPath.stripFilename().append(RTPATH_SLASH).append(destMediumFileName);
    30063023                }
    30073024                else
    30083025                {
    30093026                    /* set the target extension like on the source. Permission to convert is prohibited */
    3010                     Utf8Str suffix = i_getFormat();
     3027                    suffix = i_getFormat();
    30113028
    30123029                    if (suffix.compare("RAW", Utf8Str::CaseInsensitive) == 0)
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