Fixed wxDoSetEnv (ticket # 9588).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54241 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Neis
2008-06-15 16:42:20 +00:00
parent fafd43c578
commit 711335e205

View File

@@ -241,6 +241,14 @@ bool wxGetEnv(const wxString& var, wxString *value)
static bool wxDoSetEnv(const wxString& variable, const char *value)
{
#if defined(HAVE_SETENV)
if ( !value )
{
#ifdef HAVE_UNSETENV
return unsetenv(variable.mb_str()) == 0;
#else
value = _T(""); // mustn't pass NULL to setenv()
#endif
}
return setenv(variable.mb_str(), value, 1 /* overwrite */) == 0;
#elif defined(HAVE_PUTENV)
wxString s = variable;