Changeset 79961 in vbox for trunk/src/VBox/Main/src-server/MediumImpl.cpp
- Timestamp:
- Jul 24, 2019 3:41:32 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 132392
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/MediumImpl.cpp
r79954 r79961 2951 2951 destFName.stripPath(); 2952 2952 2953 Utf8Str suffix(destFName); 2954 suffix.stripSuffix(); 2955 2956 if (suffix.equals(destFName) && !destFName.isEmpty()) 2953 if (destFName.isNotEmpty() && !RTPathHasSuffix(destFName.c_str())) 2957 2954 { 2958 2955 /* 2959 2956 * The target path has no filename: Either "/path/to/new/location" or 2960 * just "newname" (no trailing backslash or there is no filename with 2961 * extension(suffix)). 2957 * just "newname" (no trailing backslash or there is no filename extension). 2962 2958 */ 2963 2959 if (destPath.equals(destFName)) … … 2993 2989 } 2994 2990 2995 suffix = RTPathSuffix(sourceFName.c_str());2991 const char *pszSuffix = RTPathSuffix(sourceFName.c_str()); 2996 2992 2997 2993 /* Suffix is empty and one is deduced from the medium format */ 2998 if ( suffix.isEmpty())2994 if (pszSuffix == NULL) 2999 2995 { 3000 suffix= i_getFormat();3001 if (s uffix.compare("RAW", Utf8Str::CaseInsensitive) == 0)2996 Utf8Str strExt = i_getFormat(); 2997 if (strExt.compare("RAW", Utf8Str::CaseInsensitive) == 0) 3002 2998 { 3003 2999 DeviceType_T devType = i_getDeviceType(); … … 3005 3001 { 3006 3002 case DeviceType_DVD: 3007 s uffix= "iso";3003 strExt = "iso"; 3008 3004 break; 3009 3005 case DeviceType_Floppy: 3010 s uffix= "img";3006 strExt = "img"; 3011 3007 break; 3012 3008 default: 3013 rc = setError(VERR_NOT_A_FILE, 3009 rc = setError(VERR_NOT_A_FILE, /** @todo r=bird: Mixing status codes again. */ 3014 3010 tr("Medium '%s' has RAW type. \"Move\" operation isn't supported for this type."), 3015 3011 i_getLocationFull().c_str()); … … 3017 3013 } 3018 3014 } 3019 else if (s uffix.compare("Parallels", Utf8Str::CaseInsensitive) == 0)3015 else if (strExt.compare("Parallels", Utf8Str::CaseInsensitive) == 0) 3020 3016 { 3021 s uffix= "hdd";3017 strExt = "hdd"; 3022 3018 } 3023 3019 3024 3020 /* Set the target extension like on the source. Any conversions are prohibited */ 3025 s uffix.toLower();3026 destPath.stripSuffix().append('.').append(s uffix);3021 strExt.toLower(); 3022 destPath.stripSuffix().append('.').append(strExt); 3027 3023 } 3028 3024 else 3029 destPath.stripSuffix().append( suffix);3025 destPath.stripSuffix().append(pszSuffix); 3030 3026 } 3031 3027
Note:
See TracChangeset
for help on using the changeset viewer.