SDL: Clear LD_PRELOAD so Chrome opens correctly when this application is launched by Steam

From 9b7b928765ce732ca3024a42d0281fea7192ecaf Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sat, 31 Jul 2021 23:28:41 -0700
Subject: [PATCH] Clear LD_PRELOAD so Chrome opens correctly when this
 application is launched by Steam

This fixes https://github.com/libsdl-org/SDL/issues/4565
---
 src/misc/unix/SDL_sysurl.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/misc/unix/SDL_sysurl.c b/src/misc/unix/SDL_sysurl.c
index 92263a7d2e..987f91ed8f 100644
--- a/src/misc/unix/SDL_sysurl.c
+++ b/src/misc/unix/SDL_sysurl.c
@@ -36,6 +36,8 @@ SDL_SYS_OpenURL(const char *url)
         /* Notice this is vfork and not fork! */
         const pid_t pid2 = vfork();
         if (pid2 == 0) {  /* Grandchild process will try to launch the url */
+            /* Clear LD_PRELOAD so Chrome opens correctly when this application is launched by Steam */
+            unsetenv("LD_PRELOAD");
             execlp("xdg-open", "xdg-open", url, NULL);
             _exit(EXIT_FAILURE);
         } else if (pid2 < 0) {   /* There was an error forking */