changes due to correction in ../misc/dllmain.c

for update of environ when calling putenv.

svn path=/trunk/; revision=1537
This commit is contained in:
jean 2001-01-18 13:25:33 +00:00
parent 7863eef29d
commit 20ee4eb9a7

View file

@ -3,10 +3,13 @@
#include <msvcrt/string.h>
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;
}