Changeset 38395 in vbox for trunk/src/VBox/Frontends/VBoxManage
- Timestamp:
- Aug 10, 2011 11:48:29 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp
r38290 r38395 79 79 80 80 /** 81 * An entry for a source element, including an optional filter.81 * An entry for a source element, including an optional DOS-like wildcard (*,?). 82 82 */ 83 83 typedef struct SOURCEFILEENTRY … … 93 93 { 94 94 /* No file and no directory -- maybe a filter? */ 95 if (NULL != strpbrk(RTPathFilename(pszSource), "*?")) 95 char *pszFilename = RTPathFilename(pszSource); 96 if ( pszFilename 97 && strpbrk(pszFilename, "*?")) 96 98 { 97 99 /* Yep, get the actual filter part. */ … … 938 940 { 939 941 BOOL fDirExists = FALSE; 940 HRESULT hr = pContext->pGuest-> FileExists(Bstr(pszDir).raw(),941 Bstr(pContext->pszUsername).raw(),942 Bstr(pContext->pszPassword).raw(), &fDirExists);942 HRESULT hr = pContext->pGuest->DirectoryExists(Bstr(pszDir).raw(), 943 Bstr(pContext->pszUsername).raw(), 944 Bstr(pContext->pszPassword).raw(), &fDirExists); 943 945 if (FAILED(hr)) 944 946 rc = ctrlPrintError(pContext->pGuest, COM_IIDOF(IGuest)); … … 1271 1273 case GuestDirEntryType_File: 1272 1274 { 1273 const char *pszName = Utf8Str(strName).c_str();1275 Utf8Str strFile(strName); 1274 1276 if ( !pszFilter 1275 || RTStrSimplePatternMatch(pszFilter, pszName))1277 || RTStrSimplePatternMatch(pszFilter, strFile.c_str())) 1276 1278 { 1277 1279 if (!fDirCreated) … … 1291 1293 if (RT_SUCCESS(rc)) 1292 1294 { 1293 Utf8Str strDir(strName);1294 1295 char *pszFileSource; 1295 1296 if (RTStrAPrintf(&pszFileSource, "%s/%s", 1296 szCurDir, str Dir.c_str()))1297 szCurDir, strFile.c_str())) 1297 1298 { 1298 1299 char *pszFileDest; … … 1307 1308 RTStrFree(pszFileSource); 1308 1309 } 1310 else 1311 rc = VERR_NO_MEMORY; 1309 1312 } 1310 1313 } … … 1315 1318 break; 1316 1319 } 1317 } 1318 1319 hr = pContext->pGuest->DirectoryClose(uDirHandle); 1320 if (FAILED(rc)) 1321 rc = ctrlPrintError(pContext->pGuest, COM_IIDOF(IGuest)); 1320 1321 if (RT_FAILURE(rc)) 1322 break; 1323 } 1324 1325 if (FAILED(hr)) 1326 { 1327 if (hr != E_ABORT) 1328 rc = ctrlPrintError(pContext->pGuest, COM_IIDOF(IGuest)); 1329 } 1330 1331 HRESULT hr2 = pContext->pGuest->DirectoryClose(uDirHandle); 1332 if (FAILED(hr2)) 1333 { 1334 int rc2 = ctrlPrintError(pContext->pGuest, COM_IIDOF(IGuest)); 1335 if (RT_SUCCESS(rc)) 1336 rc = rc2; 1337 } 1338 else if (SUCCEEDED(hr)) 1339 hr = hr2; 1322 1340 } 1323 1341 … … 1549 1567 RTPrintf("Source: %s\n", pszSource); 1550 1568 1551 /* @todo Files with filter?? */1569 /** @todo Files with filter?? */ 1552 1570 bool fExists; 1553 1571 vrc = ctrlCopyFileExistsOnSource(pContext, pszSource, &fExists);
Note:
See TracChangeset
for help on using the changeset viewer.