Hi there,
on Windows, getenv() is case-insensitive, whereas SDL_getenv() isn't.
#include <SDL3/SDL.h>
#include <stdlib.h>
#include <stdio.h>
int main(void)
{
const char *str1 = "SystemRoot";
const char *str2 = "SYSTEMROOT";
const char *env1 = getenv(str1);
const char *env2 = getenv(str2);
fprintf(stderr, "%s %s \n", env1, env2);
const char *env3 = SDL_getenv(str1);
const char *env4 = SDL_getenv(str2);
fprintf(stderr, "%s %s \n", env3, env4);
return 0;
}
$ LDLIBS=-lSDL3 make getenv
cc getenv.c -lSDL3 -o getenv
$ ./getenv.exe
C:\WINDOWS C:\WINDOWS
(null) C:\WINDOWS
Hi there,
on Windows,
getenv()is case-insensitive, whereasSDL_getenv()isn't.