On 02/18/2013 10:40 PM, Paul Eggert wrote:
Thanks, how about this change instead? It's a bit more conservative about always using _putenv and setting errno. And it uses WIN32_LEAN_AND_MEAN.
I need the attached additional changes to provide declarations for putenv_result and putenv_error in the internal _unsetenv function and also to use _putenv in the normal case when the argument string to putenv contains "VAR=VAL".
Otherwise it seems OK to me. Thanks for looking into this problem. jwe
--- putenv.c.orig 2013-02-19 16:45:43.140742191 -0500 +++ putenv.c 2013-02-19 17:00:49.050295109 -0500 @@ -74,6 +74,7 @@ #if HAVE__PUTENV { + int putenv_result, putenv_errno; char *name_ = malloc (len + 2); memcpy (name_, name, len); name_[len] = '='; @@ -190,7 +191,13 @@ #endif } else - *ep = string; + { +#ifdef HAVE__PUTENV + _putenv (string); +#else + *ep = string; +#endif + } return 0; }