VirtualBox

Changeset 24374 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Nov 5, 2009 10:50:38 AM (15 years ago)
Author:
vboxsync
Message:

Shared folders host service: preserve case of a 'rename' target (xTracker 3319).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedFolders/vbsf.cpp

    r24350 r24374  
    243243
    244244static int vbsfBuildFullPath (SHFLCLIENTDATA *pClient, SHFLROOT root, PSHFLSTRING pPath,
    245                               uint32_t cbPath, char **ppszFullPath, uint32_t *pcbFullPathRoot, bool fWildCard = false)
     245                              uint32_t cbPath, char **ppszFullPath, uint32_t *pcbFullPathRoot,
     246                              bool fWildCard = false, bool fPreserveLastComponent = false)
    246247{
    247248    int rc = VINF_SUCCESS;
     
    458459        {
    459460            RTFSOBJINFO info;
    460             char *pszWildCardComponent = NULL;
    461 
    462             if (fWildCard)
    463             {
    464                 /* strip off the last path component, that contains the wildcard(s) */
     461            char *pszLastComponent = NULL;
     462
     463            if (fWildCard || fPreserveLastComponent)
     464            {
     465                /* strip off the last path component, that has to be preserved: contains the wildcard(s) or a 'rename' target. */
    465466                uint32_t len = (uint32_t)strlen(pszFullPath);
    466467                char    *src = pszFullPath + len - 1;
     
    488489                    }
    489490
    490                     if (fHaveWildcards)
     491                    if (fHaveWildcards || fPreserveLastComponent)
    491492                    {
    492                         pszWildCardComponent = src;
    493                         *pszWildCardComponent = 0;
     493                        pszLastComponent = src;
     494                        *pszLastComponent = 0;
    494495                    }
    495496                }
     
    581582
    582583            }
    583             if (pszWildCardComponent)
    584                 *pszWildCardComponent = RTPATH_DELIMITER;
     584            if (pszLastComponent)
     585                *pszLastComponent = RTPATH_DELIMITER;
    585586
    586587            /* might be a new file so don't fail here! */
     
    20742075        return rc;
    20752076
    2076     rc = vbsfBuildFullPath (pClient, root, pDest, pDest->u16Size, &pszFullPathDest, NULL);
     2077    rc = vbsfBuildFullPath (pClient, root, pDest, pDest->u16Size, &pszFullPathDest, NULL, false, true);
    20772078    if (RT_SUCCESS (rc))
    20782079    {
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