Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix setenv() with value==NULL on Windows
Also comment about putenv() taking a *copy* of the string. That is Windows-specific behaviour and not POSIX-compliant, so we don't want anyone thinking it's reasonable to do it elsewhere: Tested thus, under wine and Windows 7: int main(void) { char foo[]="FOO=bar"; char *bar; putenv(foo); printf("FOO is: %s\n", getenv("FOO")); foo[5] = 'f'; printf("FOO is: %s\n", getenv("FOO")); putenv("FOO="); printf("FOO is: %s\n", getenv("FOO")); } With the following results: FOO is: bar FOO is: bar FOO is: (null) Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
- Loading branch information