VirtualBox

Ignore:
Timestamp:
Mar 10, 2014 1:54:03 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
92721
Message:

DnD: Bugfixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/DragAndDrop/DnDURIList.cpp

    r50724 r50734  
    410410    AssertPtrReturn(pszURI, VERR_INVALID_POINTER);
    411411
     412    /** @todo Check for string termination?  */
    412413#ifdef DEBUG_andy
    413414    LogFlowFunc(("pszPath=%s, fFlags=0x%x\n", pszURI, fFlags));
     
    422423        /* Add the path to our internal file list (recursive in
    423424         * the case of a directory). */
    424         char *pszFileName = RTPathFilename(pszFilePath);
    425         if (pszFileName)
    426         {
    427             Assert(pszFileName >= pszFilePath);
    428             char *pszRoot = &pszFilePath[pszFileName - pszFilePath];
    429             m_lstRoot.append(pszRoot);
    430 #ifdef DEBUG_andy
    431             LogFlowFunc(("pszFilePath=%s, pszFileName=%s, pszRoot=%s\n",
    432                          pszFilePath, pszFileName, pszRoot));
    433 #endif
    434             rc = appendPathRecursive(pszFilePath,
    435                                      pszFileName - pszFilePath,
    436                                      fFlags);
     425        size_t cbPathLen = RTPathStripTrailingSlash(pszFilePath);
     426        if (cbPathLen)
     427        {
     428            char *pszFileName = RTPathFilename(pszFilePath);
     429            if (pszFileName)
     430            {
     431                Assert(pszFileName >= pszFilePath);
     432                char *pszRoot = &pszFilePath[pszFileName - pszFilePath];
     433                m_lstRoot.append(pszRoot);
     434#ifdef DEBUG_andy
     435                LogFlowFunc(("pszFilePath=%s, pszFileName=%s, pszRoot=%s\n",
     436                             pszFilePath, pszFileName, pszRoot));
     437#endif
     438                rc = appendPathRecursive(pszFilePath,
     439                                         pszFileName - pszFilePath,
     440                                         fFlags);
     441            }
     442            else
     443                rc = VERR_NOT_FOUND;
    437444        }
    438445        else
    439             rc = VERR_NOT_FOUND;
     446            rc = VERR_INVALID_PARAMETER;
    440447
    441448        RTStrFree(pszFilePath);
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