Implementation of setenv in base incorrectly claims empty environment variable not supported on Windows
-- | @setEnv name value@ sets the specified environment variable to @value@. -- -- On Windows setting an environment variable to the /empty string/ removes -- that environment variable from the environment. For the sake of -- compatibility we adopt that behavior. In particular -- -- @ -- setEnv name \"\" -- @ -- -- has the same effect as -- -- @ -- `unsetEnv` name -- @
This sounds nice and authoritative... and it's also not true.
https://msdn.microsoft.com/en-us/library/windows/desktop/ms686206(v=vs.85).aspx states that only if the pointer is NULL (as opposed to an empty string) is the environment variable deleted.
setEnv has been given bogus semantics that don't make sense because empty environment variables ARE supported on Windows.
My suggestion is to just fix this so that setEnv takes empty environment variables. But this would be a BC breaking change.