summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Swanson2015-06-06 10:52:33 -0700
committerMike Swanson2015-06-06 10:52:33 -0700
commitb44b84beb3d7c3cf7e56bf1796d49102c5f9e562 (patch)
tree1ab6d856b542fc1ea3f69ecc50549c5e62d9e710
parent7265f8d9b9bd15a05f51f30392928fd2f869b0cd (diff)
downloadchocolate-doom-b44b84beb3d7c3cf7e56bf1796d49102c5f9e562.tar.gz
chocolate-doom-b44b84beb3d7c3cf7e56bf1796d49102c5f9e562.tar.bz2
chocolate-doom-b44b84beb3d7c3cf7e56bf1796d49102c5f9e562.zip
textscreen: Pass url directly to ShellExecute, snprintf unneeded
-rw-r--r--textscreen/txt_window.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/textscreen/txt_window.c b/textscreen/txt_window.c
index 44cdf9d1..41b8c8ef 100644
--- a/textscreen/txt_window.c
+++ b/textscreen/txt_window.c
@@ -521,11 +521,9 @@ void TXT_OpenURL(char *url)
cmd_len = strlen(url) + 30;
cmd = malloc(cmd_len);
-#if defined(_WIN32)
- TXT_snprintf(cmd, cmd_len, "%s", url);
-#elif defined(__MACOSX__)
+#if defined(__MACOSX__)
TXT_snprintf(cmd, cmd_len, "open \"%s\"", url);
-#else
+#elif !defined(_WIN32)
// The Unix situation sucks as usual, but the closest thing to a
// standard that exists is the xdg-utils package.
if (system("xdg-open --version 2>/dev/null") != 0)
@@ -539,7 +537,7 @@ void TXT_OpenURL(char *url)
#endif
#if defined(_WIN32)
- ShellExecute(NULL, "open", cmd, NULL, NULL, SW_SHOWNORMAL);
+ ShellExecute(NULL, "open", url, NULL, NULL, SW_SHOWNORMAL);
#else
system(cmd);
#endif