]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix _tputenv() return value test in wxSetEnv().
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 27 Sep 2012 13:58:26 +0000 (13:58 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 27 Sep 2012 13:58:26 +0000 (13:58 +0000)
_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

index ce4b688f887fea745258670615541f3d75d50718..afd0bb2e6c0f38742c9bbf3cc2ac680ad7ea31c5 100644 (file)
@@ -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) )