diff --git a/steam-runtime-tools/steam.c b/steam-runtime-tools/steam.c index 86e0997469e462fd14205bff3f9643546a8debc6..8046998a49e52a52dabb6c62e1e0b76de545d2e2 100644 --- a/steam-runtime-tools/steam.c +++ b/steam-runtime-tools/steam.c @@ -751,21 +751,35 @@ _srt_steam_check (const char * const *envp, SrtSteamCompatFlags _srt_steam_get_compat_flags (const char * const *envp) { + static const struct + { + const char *name; + SrtSteamCompatFlags value; + gboolean def; + } + bool_vars[] = + { + { "STEAM_COMPAT_TRACING", SRT_STEAM_COMPAT_FLAGS_SYSTEM_TRACING, FALSE }, + }; SrtSteamCompatFlags ret = SRT_STEAM_COMPAT_FLAGS_NONE; const char *value; - gboolean tracing = FALSE; + size_t i; - _srt_environ_get_boolean (envp, "STEAM_COMPAT_TRACING", &tracing, NULL); + for (i = 0; i < G_N_ELEMENTS (bool_vars); i++) + { + gboolean bool_value = bool_vars[i].def; + + _srt_environ_get_boolean (envp, bool_vars[i].name, &bool_value, NULL); - if (tracing) - ret |= SRT_STEAM_COMPAT_FLAGS_SYSTEM_TRACING; + if (bool_value) + ret |= bool_vars[i].value; + } value = _srt_environ_getenv (envp, "STEAM_COMPAT_FLAGS"); if (value != NULL) { g_auto(GStrv) tokens = NULL; - size_t i; tokens = g_strsplit (value, ",", 0);