VirtualBox

Changeset 15755 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Dec 25, 2008 10:53:52 AM (16 years ago)
Author:
vboxsync
Message:

Runtime/Windows: RTPathAbs: Truncate the trailing slash of a non-root path for compatibility with the POSIX version.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/win/path-win.cpp

    r14065 r15755  
    118118
    119119    RTUtf16Free(pwszPath);
     120
     121    if (RT_SUCCESS(rc))
     122    {
     123        /*
     124         * Remove trailing slash if the path may be pointing to a directory.
     125         */
     126        size_t cch = strlen(pszAbsPath);
     127        if (    cch > 1
     128            &&  RTPATH_IS_SLASH(pszAbsPath[cch - 1])
     129            &&  !RTPATH_IS_VOLSEP(pszAbsPath[cch - 2])
     130            &&  !RTPATH_IS_SLASH(pszAbsPath[cch - 2]))
     131            pszAbsPath[cch - 1] = '\0';
     132    }
    120133
    121134    return rc;
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