From 20ee4eb9a729a91536bda1d22670df75f699a319 Mon Sep 17 00:00:00 2001 From: jean Date: Thu, 18 Jan 2001 13:25:33 +0000 Subject: [PATCH] changes due to correction in ../misc/dllmain.c for update of environ when calling putenv. svn path=/trunk/; revision=1537 --- reactos/lib/msvcrt/stdlib/putenv.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/reactos/lib/msvcrt/stdlib/putenv.c b/reactos/lib/msvcrt/stdlib/putenv.c index bdd97a0c077..de3cab4444a 100644 --- a/reactos/lib/msvcrt/stdlib/putenv.c +++ b/reactos/lib/msvcrt/stdlib/putenv.c @@ -3,10 +3,13 @@ #include +extern int BlockEnvToEnviron(); // defined in misc/dllmain.c + int _putenv(const char *val) { char buffer[1024]; char *epos; + int res; strcpy(buffer,val); epos = strchr(buffer, '='); @@ -15,13 +18,16 @@ int _putenv(const char *val) *epos = 0; - return SetEnvironmentVariableA(buffer,epos+1); + res = SetEnvironmentVariableA(buffer,epos+1); + if (BlockEnvToEnviron() ) return 0; + return res; } int _wputenv(const wchar_t *val) { wchar_t buffer[1024]; wchar_t *epos; + int res; wcscpy(buffer,val); epos = wcschr(buffer, L'='); @@ -30,5 +36,7 @@ int _wputenv(const wchar_t *val) *epos = 0; - return SetEnvironmentVariableW(buffer,epos+1); + res = SetEnvironmentVariableW(buffer,epos+1); + if (BlockEnvToEnviron() ) return 0; + return res; }