diff --git a/steam-runtime-tools/graphics.c b/steam-runtime-tools/graphics.c index 861c3a696a8e912d2b720539b24e087933338a81..24d1a5485e21f61f4223ccc76f3fd1bffb494fdd 100644 --- a/steam-runtime-tools/graphics.c +++ b/steam-runtime-tools/graphics.c @@ -1761,6 +1761,7 @@ load_json_dir (const char *sysroot, { g_autoptr(GError) error = NULL; g_autoptr(GDir) dir_iter = NULL; + g_autofree gchar *canon = NULL; g_autofree gchar *sysrooted_dir = NULL; g_autofree gchar *suffixed_dir = NULL; const char *iter_dir; @@ -1773,6 +1774,12 @@ load_json_dir (const char *sysroot, if (dir == NULL) return; + if (!g_path_is_absolute (dir)) + { + canon = g_canonicalize_filename (dir, NULL); + dir = canon; + } + if (suffix != NULL) { suffixed_dir = g_build_filename (dir, suffix, NULL); @@ -2336,11 +2343,18 @@ egl_icd_load_json (const char *sysroot, GList **list) { g_autoptr(GError) error = NULL; + g_autofree gchar *canon = NULL; g_autofree gchar *in_sysroot = NULL; g_autofree gchar *library_path = NULL; g_return_if_fail (list != NULL); + if (!g_path_is_absolute (filename)) + { + canon = g_canonicalize_filename (filename, NULL); + filename = canon; + } + if (sysroot != NULL) in_sysroot = g_build_filename (sysroot, filename, NULL); @@ -4761,12 +4775,19 @@ vulkan_icd_load_json (const char *sysroot, GList **list) { g_autoptr(GError) error = NULL; + g_autofree gchar *canon = NULL; g_autofree gchar *in_sysroot = NULL; g_autofree gchar *api_version = NULL; g_autofree gchar *library_path = NULL; g_return_if_fail (list != NULL); + if (!g_path_is_absolute (filename)) + { + canon = g_canonicalize_filename (filename, NULL); + filename = canon; + } + if (sysroot != NULL) in_sysroot = g_build_filename (sysroot, filename, NULL);