From f2fa9ed3252914c77c126293fd280ffff4928296 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 22 Dec 2023 13:47:01 -0600 Subject: [PATCH] Revert "lsteamclient: Use getenv() in load_steamclient()." This reverts commit df4821f3612b8876bcbd2e0803f9c57f72b209d4. CW-Bug-Id: #23170 --- lsteamclient/steamclient_main.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lsteamclient/steamclient_main.c b/lsteamclient/steamclient_main.c index 56569a291..b2d0626cd 100644 --- a/lsteamclient/steamclient_main.c +++ b/lsteamclient/steamclient_main.c @@ -306,13 +306,18 @@ struct w_steam_iface *create_win_interface(const char *name, void *u_iface) static int load_steamclient(void) { + char steam_app_id[4096], ignore_child_processes[4096]; struct steamclient_init_params params = {.g_tmppath = temp_path_buffer}; - if (!(params.steam_app_id = getenv("SteamAppId"))) - params.steam_app_id_unset = TRUE; + if (!GetEnvironmentVariableA("SteamAppId", steam_app_id, ARRAY_SIZE(steam_app_id))) + params.steam_app_id_unset = GetLastError() == ERROR_ENVVAR_NOT_FOUND; + else + params.steam_app_id = steam_app_id; - if (!(params.ignore_child_processes = getenv("IgnoreChildProcesses"))) - params.ignore_child_processes_unset = TRUE; + if (!GetEnvironmentVariableA("IgnoreChildProcesses", ignore_child_processes, ARRAY_SIZE(ignore_child_processes))) + params.ignore_child_processes_unset = GetLastError() == ERROR_ENVVAR_NOT_FOUND; + else + params.ignore_child_processes = ignore_child_processes; if (STEAMCLIENT_CALL( steamclient_init, ¶ms )) return 0; return 1;