shithub: choc

Download patch

ref: 3d577f70fb8a41a6609db76bdabae30f064a95bc
parent: afa0c4c7979c1508605d0e79487f299cd03adda6
author: Simon Howard <[email protected]>
date: Sat Nov 21 11:46:17 EST 2009

Fix launch of game from setup tool.

Subversion-branch: /branches/raven-branch
Subversion-revision: 1738

--- a/src/setup/mode.c
+++ b/src/setup/mode.c
@@ -162,16 +162,18 @@
 
 static void SetExecutable(mission_config_t *config)
 {
+    char *extension;
+
     free(executable);
 
 #ifdef _WIN32
-    executable = malloc(strlen(config->executable) + 5);
-    sprintf(executable, "%s.exe", config->executable);
+    extension = ".exe";
 #else
-    executable = malloc(strlen(INSTALL_DIR) + strlen(config->executable) + 2);
-    sprintf(executable, "%s%c%s", INSTALL_DIR, DIR_SEPARATOR,
-                                  config->executable);
+    extension = "";
 #endif
+
+    executable = malloc(strlen(config->executable) + 5);
+    sprintf(executable, "%s%s", config->executable, extension);
 }
 
 static void SetMission(mission_config_t *config)