X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2b5f62a0b2db198609b45dec622a018dae37008e..62e819ee45059232300d598d9a85f9ad77a23c45:/src/msw/utils.cpp diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index 4556f6fa97..66414baaa2 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -600,14 +600,16 @@ bool wxGetEnv(const wxString& var, wxString *value) { #ifdef __WIN16__ const wxChar* ret = wxGetenv(var); - if (ret) + if ( !ret ) + return FALSE; + + if ( value ) { *value = ret; - return TRUE; } - else - return FALSE; -#else + + return TRUE; +#else // Win32 // first get the size of the buffer DWORD dwRet = ::GetEnvironmentVariable(var, NULL, 0); if ( !dwRet ) @@ -623,7 +625,7 @@ bool wxGetEnv(const wxString& var, wxString *value) } return TRUE; -#endif +#endif // Win16/32 } bool wxSetEnv(const wxString& var, const wxChar *value)