VirtualBox

Changeset 15813 in vbox for trunk/src/VBox/Runtime/r3/win


Ignore:
Timestamp:
Jan 5, 2009 4:06:55 PM (16 years ago)
Author:
vboxsync
Message:

RTPathAbs: When the path is empty we return VERR_INVALID_PARAMETER like elsewhere, not the current directory.

File:
1 edited

Legend:

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

    r15809 r15813  
    9999RTDECL(int) RTPathAbs(const char *pszPath, char *pszAbsPath, size_t cchAbsPath)
    100100{
    101     Assert(VALID_PTR(pszPath));
    102 
    103     /*
    104      * When the input path is just "", GetFullPathNameW() will return a full
    105      * executable name instead of the current directory (as the POSIX sister .
    106      * does). Go the POSIX way with the following workaround.
    107      */
    108     static const char szSingleDot[] = ".";
    109     if (!pszPath[0])
    110         pszPath = szSingleDot;
     101    /*
     102     * Validation.
     103     */
     104    AssertPtr(pszAbsPath);
     105    AssertPtr(pszPath);
     106    if (RT_UNLIKELY(!*pszPath))
     107        return VERR_INVALID_PARAMETER;
    111108
    112109    /*
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