putenv: port better to native Windows
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 19 Feb 2013 03:38:13 +0000 (19:38 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 22 Feb 2013 20:41:02 +0000 (12:41 -0800)
commit77a0af5285e21031e00629d3bda125b9493923d6
treee4722ed4d9512e516498682879cb495c46a15ae5
parentc042abf1678115fe6ab736a1c12a83ff395ea7c4
putenv: port better to native Windows

* lib/putenv.c [(_WIN32 || __WIN32__) && ! __CYGWIN__]:
Define WIN32_LEAN_AND_MEAN and include <windows.h>.
(_unsetenv): Use _putenv if available.
(putenv): Temporarily set NAME=' ' rather than NAME='x' as that's
a bit less likely to cause damage.
(putenv) [(_WIN32 || __WIN32__) && ! __CYGWIN__]:
Fix the wrong value with SetEnvironmentVariable.
(putenv) [!HAVE__PUTENV]: Simplify and match the HAVE__PUTENV
code better.
ChangeLog
lib/putenv.c