VirtualBox

Changeset 16508 in vbox for trunk


Ignore:
Timestamp:
Feb 4, 2009 11:25:49 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
42424
Message:

fixed RTEnvUnset for Windows hosts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/posix/env-posix.cpp

    r16502 r16508  
    101101    /* Ok, try remove it. */
    102102#ifdef RT_OS_WINDOWS
    103     /* Windows does not have unsetenv() */
    104     if (!putenv((char *)pszVar))
     103    /* Windows does not have unsetenv(). Clear the environment variable according to the MSN docs. */
     104    char *pszBuf;
     105    int rc = RTStrAPrintf(&pszBuf, "%s=", pszVar);
     106    if (RT_FAILURE(rc))
     107        return rc;
     108    rc = putenv(pszBuf);
     109    RTStrFree(pszBuf);
     110    if (!rc)
    105111        return VINF_SUCCESS;
    106112#else
    107     /* This is the preferred function as putenv() like used
    108      * above does neither work on Solaris nor on Darwin. */
     113    /* This is the preferred function as putenv() like used above does neither work on Solaris nor on Darwin. */
    109114    if (!unsetenv((char*)pszVar))
    110115        return VINF_SUCCESS;
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