VirtualBox

Ignore:
Timestamp:
Dec 14, 2011 11:45:11 AM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
75382
Message:

HostServices/SharedFolders: store the host folder name as UTF8 as we always convert it to UTF8 and never use the other format

Location:
trunk/src/VBox/HostServices/SharedFolders
Files:
4 edited

Legend:

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

    r39542 r39607  
    113113}
    114114
    115 static MAPPING *vbsfMappingGetByName (PRTUTF16 utf16Name, SHFLROOT *pRoot)
     115static MAPPING *vbsfMappingGetByName (PRTUTF16 pwszName, SHFLROOT *pRoot)
    116116{
    117117    unsigned i;
     
    121121        if (FolderMapping[i].fValid == true)
    122122        {
    123             if (!RTUtf16LocaleICmp(FolderMapping[i].pMapName->String.ucs2, utf16Name))
     123            if (!RTUtf16LocaleICmp(FolderMapping[i].pMapName->String.ucs2, pwszName))
    124124            {
    125125                SHFLROOT root = vbsfMappingGetRootFromIndex(i);
     
    217217        if (FolderMapping[i].fValid == false)
    218218        {
    219             FolderMapping[i].pFolderName = (PSHFLSTRING)RTMemAlloc(ShflStringSizeOfBuffer(pFolderName));
    220             Assert(FolderMapping[i].pFolderName);
    221             if (FolderMapping[i].pFolderName == NULL)
     219            int rc = RTUtf16ToUtf8(pFolderName->String.ucs2, &FolderMapping[i].pszFolderName);
     220            AssertRCReturn(rc, rc);
     221
     222            FolderMapping[i].pMapName = (PSHFLSTRING)RTMemAlloc(ShflStringSizeOfBuffer(pMapName));
     223            if (!FolderMapping[i].pMapName)
     224            {
     225                RTStrFree(FolderMapping[i].pszFolderName);
     226                AssertFailed();
    222227                return VERR_NO_MEMORY;
    223 
    224             FolderMapping[i].pFolderName->u16Length = pFolderName->u16Length;
    225             FolderMapping[i].pFolderName->u16Size   = pFolderName->u16Size;
    226             memcpy(FolderMapping[i].pFolderName->String.ucs2, pFolderName->String.ucs2, pFolderName->u16Size);
    227 
    228             FolderMapping[i].pMapName = (PSHFLSTRING)RTMemAlloc(ShflStringSizeOfBuffer(pMapName));
    229             Assert(FolderMapping[i].pMapName);
    230             if (FolderMapping[i].pMapName == NULL)
    231                 return VERR_NO_MEMORY;
     228            }
    232229
    233230            FolderMapping[i].pMapName->u16Length = pMapName->u16Length;
     
    242239            /* Check if the host file system is case sensitive */
    243240            RTFSPROPERTIES prop;
    244             char *utf8Root, *asciiroot;
    245 
    246             int rc = RTUtf16ToUtf8(FolderMapping[i].pFolderName->String.ucs2, &utf8Root);
    247             AssertRC(rc);
    248 
     241            char *pszAsciiRoot;
     242
     243            rc = RTStrUtf8ToCurrentCP(&pszAsciiRoot, FolderMapping[i].pszFolderName);
    249244            if (RT_SUCCESS(rc))
    250245            {
    251                 rc = RTStrUtf8ToCurrentCP(&asciiroot, utf8Root);
    252                 if (RT_SUCCESS(rc))
    253                 {
    254                     rc = RTFsQueryProperties(asciiroot, &prop);
    255                     AssertRC(rc);
    256                     RTStrFree(asciiroot);
    257                 }
    258                 RTStrFree(utf8Root);
     246                rc = RTFsQueryProperties(pszAsciiRoot, &prop);
     247                AssertRC(rc);
     248                RTStrFree(pszAsciiRoot);
    259249            }
     250
    260251            FolderMapping[i].fHostCaseSensitive = RT_SUCCESS(rc) ? prop.fCaseSensitive : false;
    261252            vbsfRootHandleAdd(i);
     
    302293                }
    303294
    304                 RTMemFree(FolderMapping[i].pFolderName);
     295                RTStrFree(FolderMapping[i].pszFolderName);
    305296                RTMemFree(FolderMapping[i].pMapName);
    306                 FolderMapping[i].pFolderName = NULL;
    307                 FolderMapping[i].pMapName    = NULL;
    308                 FolderMapping[i].fValid      = false;
     297                FolderMapping[i].pszFolderName = NULL;
     298                FolderMapping[i].pMapName      = NULL;
     299                FolderMapping[i].fValid        = false;
    309300                vbsfRootHandleRemove(i);
    310301                break;
     
    322313}
    323314
    324 PCRTUTF16 vbsfMappingsQueryHostRoot(SHFLROOT root, uint32_t *pcbRoot)
    325 {
    326     MAPPING *pFolderMapping = vbsfMappingGetByRoot(root);
    327     if (pFolderMapping == NULL)
    328     {
    329         AssertFailed();
    330         return NULL;
    331     }
    332 
    333     *pcbRoot = pFolderMapping->pFolderName->u16Size;
    334     return &pFolderMapping->pFolderName->String.ucs2[0];
     315const char* vbsfMappingsQueryHostRoot(SHFLROOT root)
     316{
     317    MAPPING *pFolderMapping = vbsfMappingGetByRoot(root);
     318    AssertReturn(pFolderMapping, NULL);
     319    return pFolderMapping->pszFolderName;
    335320}
    336321
     
    338323{
    339324    MAPPING *pFolderMapping = vbsfMappingGetByRoot(root);
    340     if (pFolderMapping == NULL)
    341     {
    342         AssertFailed();
    343         return false;
    344     }
    345 
     325    AssertReturn(pFolderMapping, false);
    346326    return pFolderMapping->fGuestCaseSensitive;
    347327}
     
    350330{
    351331    MAPPING *pFolderMapping = vbsfMappingGetByRoot(root);
    352     if (pFolderMapping == NULL)
    353     {
    354         AssertFailed();
    355         return false;
    356     }
    357 
     332    AssertReturn(pFolderMapping, false);
    358333    return pFolderMapping->fHostCaseSensitive;
    359334}
     
    534509#endif
    535510int vbsfMapFolder(PSHFLCLIENTDATA pClient, PSHFLSTRING pszMapName,
    536                   RTUTF16 delimiter, bool fCaseSensitive, SHFLROOT *pRoot)
     511                  RTUTF16 pwszDelimiter, bool fCaseSensitive, SHFLROOT *pRoot)
    537512{
    538513    MAPPING *pFolderMapping = NULL;
     
    549524    if (pClient->PathDelimiter == 0)
    550525    {
    551         pClient->PathDelimiter = delimiter;
     526        pClient->PathDelimiter = pwszDelimiter;
    552527    }
    553528    else
    554529    {
    555         Assert(delimiter == pClient->PathDelimiter);
     530        Assert(pwszDelimiter == pClient->PathDelimiter);
    556531    }
    557532
  • trunk/src/VBox/HostServices/SharedFolders/mappings.h

    r31052 r39607  
    2323typedef struct
    2424{
    25     PSHFLSTRING pFolderName;
     25    char        *pszFolderName;
    2626    PSHFLSTRING pMapName;
    2727    uint32_t    cMappings;
     
    4949int vbsfUnmapFolder(PSHFLCLIENTDATA pClient, SHFLROOT root);
    5050
    51 PCRTUTF16 vbsfMappingsQueryHostRoot(SHFLROOT root, uint32_t *pcbRoot);
     51const char* vbsfMappingsQueryHostRoot(SHFLROOT root);
    5252bool vbsfIsGuestMappingCaseSensitive(SHFLROOT root);
    5353bool vbsfIsHostMappingCaseSensitive(SHFLROOT root);
  • trunk/src/VBox/HostServices/SharedFolders/service.cpp

    r39540 r39607  
    2828#include <VBox/vmm/pdmifs.h>
    2929
    30 #define SHFL_SSM_VERSION        2
     30#define SHFL_SSM_VERSION_FOLDERNAME_UTF16   2
     31#define SHFL_SSM_VERSION                    3
    3132
    3233
     
    146147            uint32_t len;
    147148
    148             len = ShflStringSizeOfBuffer(pFolderMapping->pFolderName);
     149            len = strlen(pFolderMapping->pszFolderName);
    149150            rc = SSMR3PutU32(pSSM, len);
    150151            AssertRCReturn(rc, rc);
    151152
    152             rc = SSMR3PutMem(pSSM, pFolderMapping->pFolderName, len);
     153            rc = SSMR3PutStrZ(pSSM, pFolderMapping->pszFolderName);
    153154            AssertRCReturn(rc, rc);
    154155
     
    184185    AssertRCReturn(rc, rc);
    185186
    186     if (version != SHFL_SSM_VERSION)
     187    if (   version > SHFL_SSM_VERSION
     188        || version < SHFL_SSM_VERSION_FOLDERNAME_UTF16)
    187189        return VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION;
    188190
     
    219221        {
    220222            uint32_t cbFolderName;
    221             PSHFLSTRING pFolderName;
     223            char *pszFolderName;
    222224
    223225            uint32_t cbMapName;
     
    228230            AssertRCReturn(rc, rc);
    229231
    230             pFolderName = (PSHFLSTRING)RTMemAlloc(cbFolderName);
    231             AssertReturn(pFolderName != NULL, VERR_NO_MEMORY);
    232 
    233             rc = SSMR3GetMem(pSSM, pFolderName, cbFolderName);
    234             AssertRCReturn(rc, rc);
     232            if (version == SHFL_SSM_VERSION_FOLDERNAME_UTF16)
     233            {
     234                PSHFLSTRING pFolderName = (PSHFLSTRING)RTMemAlloc(cbFolderName);
     235                AssertReturn(pFolderName != NULL, VERR_NO_MEMORY);
     236
     237                rc = SSMR3GetMem(pSSM, pFolderName, cbFolderName);
     238                AssertRCReturn(rc, rc);
     239
     240                rc = RTUtf16ToUtf8(pFolderName->String.ucs2, &pszFolderName);
     241                RTMemFree(pFolderName);
     242                AssertRCReturn(rc, rc);
     243            }
     244            else
     245            {
     246                pszFolderName = (char*)RTStrAlloc(cbFolderName);
     247                AssertReturn(pszFolderName, VERR_NO_MEMORY);
     248
     249                rc = SSMR3GetStrZ(pSSM, mapping.pszFolderName, cbFolderName);
     250                AssertRCReturn(rc, rc);
     251                mapping.pszFolderName = pszFolderName;
     252            }
    235253
    236254            /* Load the map name. */
     
    250268            AssertRCReturn(rc, rc);
    251269
    252             mapping.pFolderName = pFolderName;
     270            mapping.pszFolderName = pszFolderName;
    253271            mapping.pMapName = pMapName;
    254272
     
    257275
    258276            RTMemFree(pMapName);
    259             RTMemFree(pFolderName);
     277            RTStrFree(pszFolderName);
    260278
    261279            AssertRCReturn(rc, rc);
  • trunk/src/VBox/HostServices/SharedFolders/vbsf.cpp

    r39594 r39607  
    253253{
    254254    int rc = VINF_SUCCESS;
    255 
    256255    char *pszFullPath = NULL;
    257 
    258     /* Query UCS2 root prefix for the path, cbRoot is the length in bytes including trailing (RTUTF16)0. */
    259     uint32_t cbRoot = 0;
    260     PCRTUTF16 pwszRoot = vbsfMappingsQueryHostRoot(root, &cbRoot);
    261 
    262     if (!pwszRoot || cbRoot == 0)
     256    size_t cbRoot;
     257    const char *pszRoot = vbsfMappingsQueryHostRoot(root);
     258
     259    if (   !pszRoot
     260        || !(cbRoot = strlen(pszRoot)))
    263261    {
    264262        Log(("vbsfBuildFullPath: invalid root!\n"));
     
    268266    if (BIT_FLAG(pClient->fu32Flags, SHFL_CF_UTF8))
    269267    {
    270         char *utf8Root;
    271 
    272268        /* Verify that the path is under the root directory. */
    273269        rc = vbsfPathCheck((const char *)&pPath->String.utf8[0], pPath->u16Length);
     
    275271        if (RT_SUCCESS(rc))
    276272        {
    277             rc = RTUtf16ToUtf8(pwszRoot, &utf8Root);
    278         }
    279 
    280         if (RT_SUCCESS(rc))
    281         {
    282             size_t cbUtf8Root, cbUtf8FullPath;
    283             char *utf8FullPath;
    284 
    285             cbUtf8Root = strlen(utf8Root);
    286             cbUtf8FullPath = cbUtf8Root + 1 + pPath->u16Length + 1;
    287             utf8FullPath = (char *) RTMemAllocZ(cbUtf8FullPath);
     273            size_t cbUtf8FullPath = cbRoot + 1 + pPath->u16Length + 1;
     274            char *utf8FullPath = (char *) RTMemAllocZ(cbUtf8FullPath);
    288275
    289276            if (!utf8FullPath)
     
    295282            else
    296283            {
    297                 memcpy(utf8FullPath, utf8Root, cbUtf8Root);
    298                 memcpy(utf8FullPath + cbUtf8Root + 1,
    299                        &pPath->String.utf8[0],
    300                        pPath->u16Length);
    301 
    302                 utf8FullPath[cbUtf8Root] = '/';
     284                memcpy(utf8FullPath, pszRoot, cbRoot);
     285                utf8FullPath[cbRoot] = '/';
     286                memcpy(utf8FullPath + cbRoot + 1, &pPath->String.utf8[0], pPath->u16Length);
    303287                utf8FullPath[cbUtf8FullPath - 1] = 0;
    304288                pszFullPath = utf8FullPath;
    305289
    306290                if (pcbFullPathRoot)
    307                     *pcbFullPathRoot = (uint32_t)cbUtf8Root; /* Must index the path delimiter.  */
    308             }
    309 
    310             RTStrFree(utf8Root);
     291                    *pcbFullPathRoot = (uint32_t)cbRoot; /* Must index the path delimiter. */
     292            }
    311293        }
    312294        else
     
    337319        }
    338320
    339         ::CFStringAppendCharacters(inStr, (UniChar*)pPathParameter->String.ucs2, pPathParameter->u16Length / sizeof(pPathParameter->String.ucs2[0]));
     321        ::CFStringAppendCharacters(inStr, (UniChar*)pPathParameter->String.ucs2,
     322                                   pPathParameter->u16Length / sizeof(pPathParameter->String.ucs2[0]));
    340323        ::CFStringNormalize(inStr, kCFStringNormalizationFormD);
    341324        ucs2Length = ::CFStringGetLength(inStr);
     
    351334#endif
    352335        /* Client sends us UCS2, so convert it to UTF8. */
    353         Log(("Root %ls path %.*ls\n", pwszRoot, pPath->u16Length/sizeof(pPath->String.ucs2[0]), pPath->String.ucs2));
    354 
    355         /* Allocate buffer that will be able to contain
    356          * the root prefix and the pPath converted to UTF8.
    357          * Expect a 2 bytes UCS2 to be converted to 8 bytes UTF8
    358          * in worst case.
     336        Log(("Root %s path %.*ls\n", pszRoot, pPath->u16Length/sizeof(pPath->String.ucs2[0]), pPath->String.ucs2));
     337
     338        /* Allocate buffer that will be able to contain the root prefix and
     339         * the pPath converted to UTF8. Expect a 2 bytes UCS2 to be converted
     340         * to 8 bytes UTF8 in the worst case.
    359341         */
    360         uint32_t cbFullPath = (cbRoot/sizeof(RTUTF16) + ShflStringLength(pPath)) * 4;
    361 
     342        uint32_t cbFullPath = (cbRoot + ShflStringLength(pPath)) * 4;
    362343        pszFullPath = (char *)RTMemAllocZ(cbFullPath);
    363 
    364344        if (!pszFullPath)
    365345        {
     
    368348        else
    369349        {
    370             uint32_t cb = cbFullPath;
    371 
    372             rc = RTUtf16ToUtf8Ex(pwszRoot, RTSTR_MAX, &pszFullPath, cb, NULL);
    373             if (RT_FAILURE(rc))
    374             {
    375                 AssertFailed();
    376 #ifdef RT_OS_DARWIN
    377                 RTMemFree(pPath);
    378                 pPath = pPathParameter;
    379 #endif
    380                 return rc;
    381             }
    382 
    383             char *dst = pszFullPath;
    384 
    385             cbRoot = (uint32_t)strlen(dst);
    386             if (dst[cbRoot - 1] != RTPATH_DELIMITER)
    387             {
    388                 dst[cbRoot] = RTPATH_DELIMITER;
    389                 cbRoot++;
     350            memcpy(pszFullPath, pszRoot, cbRoot + 1);
     351            char *pszDst = pszFullPath;
     352            size_t cbDst = strlen(pszDst);
     353            size_t cb    = cbFullPath;
     354            if (pszDst[cbDst - 1] != RTPATH_DELIMITER)
     355            {
     356                pszDst[cbDst] = RTPATH_DELIMITER;
     357                cbDst++;
    390358            }
    391359
    392360            if (pcbFullPathRoot)
    393                 *pcbFullPathRoot = cbRoot - 1; /* Must index the path delimiter.  */
    394 
    395             dst   += cbRoot;
    396             cb    -= cbRoot;
     361                *pcbFullPathRoot = cbDst - 1; /* Must index the path delimiter.  */
     362
     363            pszDst += cbDst;
     364            cb     -= cbDst;
    397365
    398366            if (pPath->u16Length)
    399367            {
    400368                /* Convert and copy components. */
    401                 PRTUTF16 src = &pPath->String.ucs2[0];
     369                PRTUTF16 pwszSrc = &pPath->String.ucs2[0];
    402370
    403371                /* Correct path delimiters */
    404372                if (pClient->PathDelimiter != RTPATH_DELIMITER)
    405373                {
    406                     LogFlow(("Correct path delimiter in %ls\n", src));
    407                     while (*src)
     374                    LogFlow(("Correct path delimiter in %ls\n", pwszSrc));
     375                    while (*pwszSrc)
    408376                    {
    409                         if (*src == pClient->PathDelimiter)
    410                             *src = RTPATH_DELIMITER;
    411                         src++;
     377                        if (*pwszSrc == pClient->PathDelimiter)
     378                            *pwszSrc = RTPATH_DELIMITER;
     379                        pwszSrc++;
    412380                    }
    413                     src = &pPath->String.ucs2[0];
    414                     LogFlow(("Corrected string %ls\n", src));
     381                    pwszSrc = &pPath->String.ucs2[0];
     382                    LogFlow(("Corrected string %ls\n", pwszSrc));
    415383                }
    416                 if (*src == RTPATH_DELIMITER)
    417                     src++;  /* we already appended a delimiter to the first part */
    418 
    419                 rc = RTUtf16ToUtf8Ex(src, RTSTR_MAX, &dst, cb, NULL);
     384                if (*pwszSrc == RTPATH_DELIMITER)
     385                    pwszSrc++;  /* we already appended a delimiter to the first part */
     386
     387                rc = RTUtf16ToUtf8Ex(pwszSrc, RTSTR_MAX, &pszDst, cb, NULL);
    420388                if (RT_FAILURE(rc))
    421389                {
     
    428396                }
    429397
    430                 uint32_t l = (uint32_t)strlen(dst);
     398                cbDst = (uint32_t)strlen(pszDst);
    431399
    432400                /* Verify that the path is under the root directory. */
    433                 rc = vbsfPathCheck(dst, l);
    434 
     401                rc = vbsfPathCheck(pszDst, cbDst);
    435402                if (RT_FAILURE(rc))
    436403                {
     
    442409                }
    443410
    444                 cb -= l;
    445                 dst += l;
     411                cb     -= cbDst;
     412                pszDst += cbDst;
    446413
    447414                Assert(cb > 0);
     
    449416
    450417            /* Nul terminate the string */
    451             *dst = 0;
     418            *pszDst = 0;
    452419        }
    453420#ifdef RT_OS_DARWIN
     
    469436            {
    470437                /* strip off the last path component, that has to be preserved: contains the wildcard(s) or a 'rename' target. */
    471                 uint32_t len = (uint32_t)strlen(pszFullPath);
    472                 char    *src = pszFullPath + len - 1;
    473 
    474                 while(src > pszFullPath)
     438                size_t cb = strlen(pszFullPath);
     439                char *pszSrc = pszFullPath + cb - 1;
     440
     441                while (pszSrc > pszFullPath)
    475442                {
    476                     if (*src == RTPATH_DELIMITER)
     443                    if (*pszSrc == RTPATH_DELIMITER)
    477444                        break;
    478                     src--;
     445                    pszSrc--;
    479446                }
    480                 if (*src == RTPATH_DELIMITER)
     447                if (*pszSrc == RTPATH_DELIMITER)
    481448                {
    482449                    bool fHaveWildcards = false;
    483                     char *temp = src;
    484 
    485                     while(*temp)
     450                    char *psz = pszSrc;
     451
     452                    while (*psz)
    486453                    {
    487                         char uc = *temp;
    488                         if (uc == '*' || uc == '?' || uc == '>' || uc == '<' || uc == '"')
     454                        char ch = *psz;
     455                        if (ch == '*' || ch == '?' || ch == '>' || ch == '<' || ch == '"')
    489456                        {
    490457                            fHaveWildcards = true;
    491458                            break;
    492459                        }
    493                         temp++;
     460                        psz++;
    494461                    }
    495462
    496463                    if (fHaveWildcards || fPreserveLastComponent)
    497464                    {
    498                         pszLastComponent = src;
     465                        pszLastComponent = pszSrc;
    499466                        *pszLastComponent = 0;
    500467                    }
     
    506473            if (rc == VERR_FILE_NOT_FOUND || rc == VERR_PATH_NOT_FOUND)
    507474            {
    508                 uint32_t len = (uint32_t)strlen(pszFullPath);
    509                 char    *src = pszFullPath + len - 1;
     475                size_t cb = strlen(pszFullPath);
     476                char   *pszSrc = pszFullPath + cb - 1;
    510477
    511478                Log(("Handle case insensitive guest fs on top of host case sensitive fs for %s\n", pszFullPath));
    512479
    513480                /* Find partial path that's valid */
    514                 while(src > pszFullPath)
     481                while (pszSrc > pszFullPath)
    515482                {
    516                     if (*src == RTPATH_DELIMITER)
     483                    if (*pszSrc == RTPATH_DELIMITER)
    517484                    {
    518                         *src = 0;
     485                        *pszSrc = 0;
    519486                        rc = RTPathQueryInfoEx(pszFullPath, &info, RTFSOBJATTRADD_NOTHING, SHFL_RT_LINK(pClient));
    520                         *src = RTPATH_DELIMITER;
     487                        *pszSrc = RTPATH_DELIMITER;
    521488                        if (rc == VINF_SUCCESS)
    522489                        {
    523490#ifdef DEBUG
    524                             *src = 0;
     491                            *pszSrc = 0;
    525492                            Log(("Found valid partial path %s\n", pszFullPath));
    526                             *src = RTPATH_DELIMITER;
     493                            *pszSrc = RTPATH_DELIMITER;
    527494#endif
    528495                            break;
     
    530497                    }
    531498
    532                     src--;
     499                    pszSrc--;
    533500                }
    534                 Assert(*src == RTPATH_DELIMITER && RT_SUCCESS(rc));
    535                 if (    *src == RTPATH_DELIMITER
     501                Assert(*pszSrc == RTPATH_DELIMITER && RT_SUCCESS(rc));
     502                if (    *pszSrc == RTPATH_DELIMITER
    536503                    &&  RT_SUCCESS(rc))
    537504                {
    538                     src++;
     505                    pszSrc++;
    539506                    for (;;)
    540507                    {
    541                         char *end = src;
     508                        char *pszEnd = pszSrc;
    542509                        bool fEndOfString = true;
    543510
    544                         while(*end)
     511                        while (*pszEnd)
    545512                        {
    546                             if (*end == RTPATH_DELIMITER)
     513                            if (*pszEnd == RTPATH_DELIMITER)
    547514                                break;
    548                             end++;
     515                            pszEnd++;
    549516                        }
    550517
    551                         if (*end == RTPATH_DELIMITER)
     518                        if (*pszEnd == RTPATH_DELIMITER)
    552519                        {
    553520                            fEndOfString = false;
    554                             *end = 0;
    555                             rc = RTPathQueryInfoEx(src, &info, RTFSOBJATTRADD_NOTHING, SHFL_RT_LINK(pClient));
     521                            *pszEnd = 0;
     522                            rc = RTPathQueryInfoEx(pszSrc, &info, RTFSOBJATTRADD_NOTHING, SHFL_RT_LINK(pClient));
    556523                            Assert(rc == VINF_SUCCESS || rc == VERR_FILE_NOT_FOUND || rc == VERR_PATH_NOT_FOUND);
    557524                        }
    558                         else if (end == src)
     525                        else if (pszEnd == pszSrc)
    559526                            rc = VINF_SUCCESS;  /* trailing delimiter */
    560527                        else
     
    564531                        {
    565532                            /* path component is invalid; try to correct the casing */
    566                             rc = vbsfCorrectCasing(pClient, pszFullPath, src);
     533                            rc = vbsfCorrectCasing(pClient, pszFullPath, pszSrc);
    567534                            if (RT_FAILURE(rc))
    568535                            {
    569536                                if (!fEndOfString)
    570                                     *end = RTPATH_DELIMITER; /* restore the original full path */
     537                                    *pszEnd = RTPATH_DELIMITER; /* restore the original full path */
    571538                                break;
    572539                            }
     
    576543                            break;
    577544
    578                         *end = RTPATH_DELIMITER;
    579                         src = end + 1;
     545                        *pszEnd = RTPATH_DELIMITER;
     546                        pszSrc = pszEnd + 1;
    580547                    }
    581548                    if (RT_FAILURE(rc))
     
    15931560    }
    15941561
    1595     while(cbBufferOrg)
     1562    while (cbBufferOrg)
    15961563    {
    15971564        size_t cbDirEntrySize = cbDirEntry;
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