Skip to content
Snippets Groups Projects
Commit 654083f2 authored by Ludovico de Nittis's avatar Ludovico de Nittis
Browse files

Merge branch 'wip/smcv/Wshadow' into 'master'

runtime: Avoid shadowing POSIX environ

See merge request steam/steam-runtime-tools!34
parents f1229dc2 8720b7ca
No related branches found
No related tags found
1 merge request!34runtime: Avoid shadowing POSIX environ
Pipeline #1474 canceled
......@@ -156,11 +156,14 @@ _srt_runtime_check (const char *bin32,
gchar *version_txt = NULL;
gsize len = 0;
GError *error = NULL;
GStrv environ = NULL;
GStrv my_environ = NULL;
environ = (custom_environ == NULL) ? g_get_environ () : g_strdupv (custom_environ);
if (custom_environ == NULL)
my_environ = g_get_environ ();
else
my_environ = g_strdupv (custom_environ);
env = g_environ_getenv (environ, "STEAM_RUNTIME");
env = g_environ_getenv (my_environ, "STEAM_RUNTIME");
if (bin32 != NULL)
expected_path = g_build_filename (bin32, "steam-runtime", NULL);
......@@ -295,12 +298,12 @@ _srt_runtime_check (const char *bin32,
might_be_stattable (path, "amd64/usr/bin", &amd64_bin);
might_be_stattable (path, "i386/usr/bin", &i386_bin);
env = g_environ_getenv (environ, "STEAM_RUNTIME_PREFER_HOST_LIBRARIES");
env = g_environ_getenv (my_environ, "STEAM_RUNTIME_PREFER_HOST_LIBRARIES");
if (g_strcmp0 (env, "0") == 0)
issues |= SRT_RUNTIME_ISSUES_NOT_USING_NEWER_HOST_LIBRARIES;
env = g_environ_getenv (environ, "LD_LIBRARY_PATH");
env = g_environ_getenv (my_environ, "LD_LIBRARY_PATH");
if (env == NULL)
{
......@@ -389,7 +392,7 @@ _srt_runtime_check (const char *bin32,
g_strfreev (entries);
}
env = g_environ_getenv (environ, "PATH");
env = g_environ_getenv (my_environ, "PATH");
if (env == NULL)
{
......@@ -452,7 +455,7 @@ out:
g_free (path);
g_free (version);
g_free (version_txt);
g_strfreev (environ);
g_strfreev (my_environ);
g_clear_error (&error);
return issues;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment