From 07860b2473e32f6852d1f7401f190f7228bd0fab Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Mon, 23 Mar 2020 09:39:44 -0500 Subject: [PATCH] steam_helper: Fix XDG_CONFIG_HOME handling --- steam_helper/steam.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/steam_helper/steam.cpp b/steam_helper/steam.cpp index e9e3c06f..bc0d8afb 100644 --- a/steam_helper/steam.cpp +++ b/steam_helper/steam.cpp @@ -124,19 +124,21 @@ static std::string get_linux_vr_path(void) { const char *e; + static const char *openvr_path = "/openvr/openvrpaths.vrpath"; + e = getenv("VR_PATHREG_OVERRIDE"); if(e && *e) return e; e = getenv("XDG_CONFIG_HOME"); + if(e && *e) + return std::string(e) + openvr_path; - if(!e || !*e) - e = getenv("HOME"); + e = getenv("HOME"); + if(e && *e) + return std::string(e) + "/.config" + openvr_path; - if(!e || !*e) - return ""; - - return std::string(e) + "/.config/openvr/openvrpaths.vrpath"; + return ""; } static bool get_windows_vr_path(WCHAR *out_path, bool create)