2 #include <msvcrt/stdlib.h>
3 #include <msvcrt/string.h>
6 #include <msvcrt/msvcrtdbg.h>
9 extern int BlockEnvToEnviron(); // defined in misc/dllmain.c
11 int _putenv(const char* val)
17 DPRINT("_putenv('%s')\n", val);
18 epos = strchr(val, '=');
21 buffer = (char*)malloc(epos - val + 1);
24 strncpy(buffer, val, epos - val);
25 buffer[epos - val] = 0;
26 res = SetEnvironmentVariableA(buffer, epos+1);
28 if (BlockEnvToEnviron())