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:
@@ -241,6 +241,14 @@ bool wxGetEnv(const wxString& var, wxString *value)
|
|||||||
static bool wxDoSetEnv(const wxString& variable, const char *value)
|
static bool wxDoSetEnv(const wxString& variable, const char *value)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_SETENV)
|
#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;
|
return setenv(variable.mb_str(), value, 1 /* overwrite */) == 0;
|
||||||
#elif defined(HAVE_PUTENV)
|
#elif defined(HAVE_PUTENV)
|
||||||
wxString s = variable;
|
wxString s = variable;
|
||||||
|
Reference in New Issue
Block a user