mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
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:
parent
7863eef29d
commit
20ee4eb9a7
1 changed files with 10 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue