VirtualBox

儲存庫 vbox 的更動 16508


忽略:
時間撮記:
2009-2-4 上午11:25:49 (16 年 以前)
作者:
vboxsync
訊息:

fixed RTEnvUnset for Windows hosts

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • 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;
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette