Re: [RFA/mingw32] environment variables are case-insensitive on win32

Jerome Guitton
2012-11-30T15:34:05Z

Eli Zaretskii (eliz@gnu.org):

> This is Bash, not Cygwin. What happens if you define an environment
> variable outside of a Cygwin program, and then use getenv in a Cygwin
> program with different letter-case?

I tried something similar actually:

#include <stdio.h>
#include <stdlib.h>

int
main()
{
char *name;

#if defined(_WIN32) && !defined(__CYGWIN__)
_putenv ("foobar=set");
#else
setenv("foobar", "set", 1);
#endif
name = getenv("FooBar");

if (name && strcmp (name, "set") == 0)
printf ("not case sensitive\n");
else
printf ("case sensitive\n");

return 1;
}

Same result: case sensitive.