VirtualBox

Changeset 33809 in vbox


Ignore:
Timestamp:
Nov 5, 2010 6:19:15 PM (14 years ago)
Author:
vboxsync
Message:

VBoxManage/Guest Copy: Avoid path duplication.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp

    r33798 r33809  
    11981198                PDIRECTORYENTRY pNode;
    11991199                uint32_t uCurObject = 1;
    1200                 char szDest[RTPATH_MAX];
    12011200                RTListForEach(&listToCopy, pNode, DIRECTORYENTRY, Node)
    12021201                {
    1203                     /*
    1204                      * Build final destination path: Append the relative path
    1205                      * stored in the directory node to the destination directory
    1206                      * specified on the command line.
    1207                      */
    1208                     szDest[0] = '\0'; /* Terminate string, needed for RTPathAppend(). */
    1209                     vrc = RTPathAppend(szDest, sizeof(szDest), Utf8Dest.c_str());
    1210                     if (RT_SUCCESS(vrc))
    1211                         vrc = RTPathAppend(szDest, sizeof(szDest), pNode->pszDestPath);
    1212 
    1213                     if (RT_SUCCESS(vrc))
    1214                     {
    1215                         if (fVerbose)
     1202                    if (fVerbose)
    12161203#ifndef DEBUG
    1217                             RTPrintf("Copying \"%s\" (%u/%u) ...\n",
    1218                                      pNode->pszSourcePath, uCurObject, cObjects);
     1204                        RTPrintf("Copying \"%s\" (%u/%u) ...\n",
     1205                                 pNode->pszSourcePath, uCurObject, cObjects);
    12191206#else
    1220                             RTPrintf("Copying \"%s\" to \"%s\" (%u/%u) ...\n",
    1221                                      pNode->pszSourcePath, pNode->pszDestPath, uCurObject, cObjects);
     1207                        RTPrintf("Copying \"%s\" to \"%s\" (%u/%u) ...\n",
     1208                                 pNode->pszSourcePath, pNode->pszDestPath, uCurObject, cObjects);
    12221209#endif
    1223                         /* Finally copy the desired file (if no dry run selected). */
    1224                         if (!fDryRun)
    1225                             vrc = ctrlCopyFileToGuest(guest, pNode->pszSourcePath, szDest,
    1226                                                       Utf8UserName.c_str(), Utf8Password.c_str(), uFlags);
    1227                     }
    1228                     else
    1229                         RTMsgError("Error building destination file name, rc=%Rrc\n", vrc);
     1210                    /* Finally copy the desired file (if no dry run selected). */
     1211                    if (!fDryRun)
     1212                        vrc = ctrlCopyFileToGuest(guest, pNode->pszSourcePath, pNode->pszDestPath,
     1213                                                  Utf8UserName.c_str(), Utf8Password.c_str(), uFlags);
    12301214                    if (RT_FAILURE(vrc))
    12311215                        break;
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