From: Vadim Zeitlin Date: Sat, 7 Dec 2002 00:58:11 +0000 (+0000) Subject: fix for wxGetEnv() under Win16 (!) (bug 645368) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/e622dd68c2b1ae0616963ed3e761d6b3b4596b12 fix for wxGetEnv() under Win16 (!) (bug 645368) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18085 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- 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)