From 413af2f5f166649a4f12419c9125837381f3547c Mon Sep 17 00:00:00 2001
From: Elad Lahav <[EMAIL REDACTED]>
Date: Tue, 10 Jan 2023 09:06:36 -0500
Subject: [PATCH] Addressed comments
---
src/misc/unix/SDL_sysurl.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/misc/unix/SDL_sysurl.c b/src/misc/unix/SDL_sysurl.c
index b581daee8ecb..5fbc7cd77f60 100644
--- a/src/misc/unix/SDL_sysurl.c
+++ b/src/misc/unix/SDL_sysurl.c
@@ -40,6 +40,8 @@ int SDL_SYS_OpenURL(const char *url)
#if USE_POSIX_SPAWN
pid_t pid2;
const char *args[] = { "xdg-open", url, NULL };
+ /* Clear LD_PRELOAD so Chrome opens correctly when this application is launched by Steam */
+ unsetenv("LD_PRELOAD");
if (posix_spawnp(&pid2, args[0], NULL, NULL, (char **)args, environ) == 0) {
/* Child process doesn't wait for possibly-blocking grandchild. */
_exit(EXIT_SUCCESS);
@@ -61,7 +63,7 @@ int SDL_SYS_OpenURL(const char *url)
/* Child process doesn't wait for possibly-blocking grandchild. */
_exit(EXIT_SUCCESS);
}
-#endif
+#endif /* USE_POSIX_SPAWN */
} else if (pid1 < 0) {
return SDL_SetError("fork() failed: %s", strerror(errno));
} else {