Changeset 67226 in vbox
- Timestamp:
- Jun 2, 2017 9:27:26 AM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 115915
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/MediumImpl.cpp
r67205 r67226 3067 3067 /* play with locations */ 3068 3068 { 3069 /* get source path and filename */3069 /* get source path and filename */ 3070 3070 Utf8Str sourceMediumPath = i_getLocationFull(); 3071 3071 Utf8Str sourceMediumFileName = i_getName(); … … 3079 3079 } 3080 3080 3081 /* extract destination path and filename */3081 /* extract destination path and filename */ 3082 3082 Utf8Str destMediumPath(aLocation); 3083 3083 Utf8Str destMediumFileName(destMediumPath); … … 3085 3085 3086 3086 Utf8Str suffix(destMediumFileName); 3087 suffix.stripSuffix(); //for small trick, see next condition3088 3089 if (suffix.equals(destMediumFileName) && !destMediumFileName.isEmpty())3087 suffix.stripSuffix(); 3088 3089 if (suffix.equals(destMediumFileName) && !destMediumFileName.isEmpty()) 3090 3090 { 3091 3091 /* … … 3103 3103 destMediumPath = destMediumFileName; 3104 3104 } 3105 /* case when new path looks like "/path/to/new/location"3106 * In this case just set destMediumFileName to NULL and3107 * and add '/' in the end of path.destMediumPath3108 */3109 3105 else 3110 3106 { 3107 /* new path looks like "/path/to/new/location" */ 3111 3108 destMediumFileName.setNull(); 3112 3109 destMediumPath.append(RTPATH_SLASH); … … 3116 3113 if (destMediumFileName.isEmpty()) 3117 3114 { 3118 /* case when a target name is absent*/3115 /* No target name */ 3119 3116 destMediumPath.append(sourceMediumFileName); 3120 3117 } … … 3123 3120 if (destMediumPath.equals(destMediumFileName)) 3124 3121 { 3125 /* the passed target path consist of only a filename without directory 3122 /* 3123 * the passed target path consist of only a filename without directory 3126 3124 * next move medium within the source directory with the passed new name 3127 3125 */ … … 3132 3130 if (suffix.compare("RAW", Utf8Str::CaseInsensitive) == 0) 3133 3131 { 3134 if(i_getDeviceType() == DeviceType_DVD) 3135 { 3132 if (i_getDeviceType() == DeviceType_DVD) 3136 3133 suffix = "iso"; 3137 }3138 3134 else 3139 3135 { … … 3151 3147 if (i_isMediumFormatFile()) 3152 3148 { 3149 /* Path must be absolute */ 3150 char *pszAbs = RTPathAbsDup(destMediumPath.c_str()); 3151 int iCmp = destMediumPath.compare(pszAbs, Utf8Str::CaseInsensitive); 3152 RTStrFree(pszAbs); 3153 if (iCmp) 3154 { 3155 rc = setError(VBOX_E_FILE_ERROR, 3156 tr("The given target path '%s' is not absolute"), 3157 destMediumPath.c_str()); 3158 throw rc; 3159 } 3153 3160 /* Check path for a new file object */ 3154 3161 rc = VirtualBox::i_ensureFilePathExists(destMediumPath, true); … … 6694 6701 Utf8Str Medium::i_getNewLocationForMoving() const 6695 6702 { 6696 if (m->fMoveThisMedium == true)6703 if (m->fMoveThisMedium == true) 6697 6704 return m->strNewLocationFull; 6698 6705 else
Note:
See TracChangeset
for help on using the changeset viewer.