VirtualBox

Changeset 3965 in vbox


Ignore:
Timestamp:
Aug 1, 2007 2:44:40 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
23384
Message:

Deal with wildcard path parts

File:
1 edited

Legend:

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

    r3960 r3965  
    159159
    160160static int vbsfBuildFullPath (SHFLCLIENTDATA *pClient, SHFLROOT root, SHFLSTRING *pPath,
    161                               uint32_t cbPath, char **ppszFullPath, uint32_t *pcbFullPathRoot)
     161                              uint32_t cbPath, char **ppszFullPath, uint32_t *pcbFullPathRoot, bool fWildCard = false)
    162162{
    163163    int rc = VINF_SUCCESS;
     
    305305#if 0
    306306        /* When the host file system is case sensitive and the guest expects a case insensitive fs, then problems can occur */
    307         if (    vbsfIsHostMappingCaseSensitive (root)
     307        if (     vbsfIsHostMappingCaseSensitive (root)
    308308            &&  !vbsfIsGuestMappingCaseSensitive(root))
    309309        {
    310310            RTFSOBJINFO info;
     311            char *pszWildCardComponent = NULL;
     312
     313            if (fWildCard)
     314            {
     315                /* strip off the last path component, that contains the wildcard(s) */
     316                uint32_t len = strlen(pszFullPath);
     317                char    *src = pszFullPath + len - 1;
     318
     319                while(src > pszFullPath)
     320                {
     321                    if (*src == RTPATH_DELIMITER)
     322                        break;
     323                    src--;
     324                }
     325                if (*src == RTPATH_DELIMITER)
     326                {
     327                    pszWildCardComponent = src;
     328                    *pszWildCardComponent = 0;
     329                }
     330            }
     331
    311332            rc = RTPathQueryInfo(pszFullPath, &info, RTFSOBJATTRADD_NOTHING);
    312333            if (rc == VERR_FILE_NOT_FOUND || rc == VERR_PATH_NOT_FOUND)
     
    386407            }
    387408        }
     409        if (fWildCard)
     410        {
     411            Assert(pszWildCardComponent);
     412            *pszWildCardComponent = RTPATH_DELIMITER;
     413        }
    388414#endif
    389415        *ppszFullPath = pszFullPath;
     
    10951121            Assert(pHandle->dir.pLastValidEntry == 0);
    10961122
    1097             rc = vbsfBuildFullPath (pClient, root, pPath, pPath->u16Size, &pszFullPath, NULL);
     1123            rc = vbsfBuildFullPath (pClient, root, pPath, pPath->u16Size, &pszFullPath, NULL, true);
    10981124
    10991125            if (VBOX_SUCCESS (rc))
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette