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