From d993c262a153f0035370122337838a3d747acc51 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 27 Sep 2012 13:58:26 +0000 Subject: [PATCH] Fix _tputenv() return value test in wxSetEnv(). _tputenv() returns -1, not 0, on error, as all the other CRT functions, so the test added by r72496 resulted in wxSetEnv() and wxUnsetEnv() always failing when using MSVC. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72564 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/utils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index ce4b688f88..afd0bb2e6c 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -636,7 +636,7 @@ bool wxDoSetEnv(const wxString& var, const wxChar *value) envstr += '='; if ( value ) envstr += value; - if ( !_tputenv(envstr.t_str()) ) + if ( _tputenv(envstr.t_str()) != 0 ) return false; #else // other compiler if ( !::SetEnvironmentVariable(var.t_str(), value) ) -- 2.47.2