diff --git a/include/SDL3/SDL_stdinc.h b/include/SDL3/SDL_stdinc.h index 21113ac6a..b10de1782 100644 --- a/include/SDL3/SDL_stdinc.h +++ b/include/SDL3/SDL_stdinc.h @@ -1030,11 +1030,11 @@ extern SDL_DECLSPEC void SDLCALL SDL_CleanupEnvironment(void); /** * Create a set of environment variables * - * \param empty SDL_TRUE to create an empty environment, SDL_FALSE to initialize it from the C runtime environment. + * \param populated SDL_TRUE to initialize it from the C runtime environment, SDL_FALSE to create an empty environment. * \returns a pointer to the new environment or NULL on failure; call SDL_GetError() * for more information. * - * \threadsafety If `empty` is SDL_TRUE, it is safe to call this function from any thread, otherwise it is safe if no other threads are calling setenv() or unsetenv() + * \threadsafety If `populated` is SDL_FALSE, it is safe to call this function from any thread, otherwise it is safe if no other threads are calling setenv() or unsetenv() * * \since This function is available since SDL 3.0.0. * @@ -1044,7 +1044,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_CleanupEnvironment(void); * \sa SDL_UnsetEnvironmentVariable * \sa SDL_DestroyEnvironment */ -extern SDL_DECLSPEC SDL_Environment * SDLCALL SDL_CreateEnvironment(SDL_bool empty); +extern SDL_DECLSPEC SDL_Environment * SDLCALL SDL_CreateEnvironment(SDL_bool populated); /** * Get the value of a variable in the environment. diff --git a/src/dialog/unix/SDL_zenitydialog.c b/src/dialog/unix/SDL_zenitydialog.c index b816d0226..17116e391 100644 --- a/src/dialog/unix/SDL_zenitydialog.c +++ b/src/dialog/unix/SDL_zenitydialog.c @@ -207,7 +207,7 @@ static void run_zenity(zenityArgs* arg_struct) goto done; } - env = SDL_CreateEnvironment(SDL_FALSE); + env = SDL_CreateEnvironment(true); if (!env) { goto done; } diff --git a/src/misc/unix/SDL_sysurl.c b/src/misc/unix/SDL_sysurl.c index 69517f162..e60b40981 100644 --- a/src/misc/unix/SDL_sysurl.c +++ b/src/misc/unix/SDL_sysurl.c @@ -41,7 +41,7 @@ bool SDL_SYS_OpenURL(const char *url) SDL_Process *process = NULL; bool result = false; - env = SDL_CreateEnvironment(SDL_FALSE); + env = SDL_CreateEnvironment(true); if (!env) { goto done; } diff --git a/src/stdlib/SDL_getenv.c b/src/stdlib/SDL_getenv.c index 7c0beb6e5..c29fc3149 100644 --- a/src/stdlib/SDL_getenv.c +++ b/src/stdlib/SDL_getenv.c @@ -329,7 +329,7 @@ static SDL_Environment *SDL_environment; SDL_Environment *SDL_GetEnvironment(void) { if (!SDL_environment) { - SDL_environment = SDL_CreateEnvironment(false); + SDL_environment = SDL_CreateEnvironment(true); } return SDL_environment; } @@ -344,7 +344,7 @@ void SDL_CleanupEnvironment(void) } } -SDL_Environment *SDL_CreateEnvironment(SDL_bool empty) +SDL_Environment *SDL_CreateEnvironment(SDL_bool populated) { SDL_Environment *env = SDL_calloc(1, sizeof(*env)); if (!env) { @@ -360,7 +360,7 @@ SDL_Environment *SDL_CreateEnvironment(SDL_bool empty) // Don't fail if we can't create a mutex (e.g. on a single-thread environment) env->lock = SDL_CreateMutex(); - if (!empty) { + if (populated) { #ifdef SDL_PLATFORM_WINDOWS LPWCH strings = GetEnvironmentStringsW(); if (strings) { diff --git a/test/testprocess.c b/test/testprocess.c index 6f59c5ad2..0c6a13886 100644 --- a/test/testprocess.c +++ b/test/testprocess.c @@ -40,7 +40,7 @@ static char **DuplicateEnvironment(const char *key0, ...) va_list ap; const char *keyN; SDL_Environment *env = SDL_GetEnvironment(); - SDL_Environment *new_env = SDL_CreateEnvironment(SDL_TRUE); + SDL_Environment *new_env = SDL_CreateEnvironment(SDL_FALSE); char **result; if (key0) {