summaryrefslogtreecommitdiff
path: root/setup/execute.c
diff options
context:
space:
mode:
authorSimon Howard2006-10-24 22:26:20 +0000
committerSimon Howard2006-10-24 22:26:20 +0000
commitda4d5c225390d1864b4c103bf76dcf6ba7238659 (patch)
treefd81c425672b027c10b6cfd100d5a749493077f8 /setup/execute.c
parentf25e3e2d6ee2be725eade97fef60e615ff7f7177 (diff)
downloadchocolate-doom-da4d5c225390d1864b4c103bf76dcf6ba7238659.tar.gz
chocolate-doom-da4d5c225390d1864b4c103bf76dcf6ba7238659.tar.bz2
chocolate-doom-da4d5c225390d1864b4c103bf76dcf6ba7238659.zip
Don't rely on INSTALL_DIR for the Win32 build.
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 735
Diffstat (limited to 'setup/execute.c')
-rw-r--r--setup/execute.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/setup/execute.c b/setup/execute.c
index b2933c9a..5e8a24ea 100644
--- a/setup/execute.c
+++ b/setup/execute.c
@@ -31,6 +31,12 @@
#include "execute.h"
#include "m_argv.h"
+#ifdef _WIN32
+#define DOOM_BINARY "chocolate-doom.exe"
+#else
+#define DOOM_BINARY INSTALL_DIR "/chocolate-doom"
+#endif
+
struct execute_context_s
{
char *response_file;
@@ -97,14 +103,10 @@ void ExecuteDoom(execute_context_t *context)
// Build the command line
- cmdline = malloc(strlen(INSTALL_DIR)
+ cmdline = malloc(strlen(DOOM_BINARY)
+ strlen(context->response_file) + 20);
-#ifdef _WIN32
- sprintf(cmdline, "chocolate-doom @%s", context->response_file);
-#else
- sprintf(cmdline, INSTALL_DIR "/chocolate-doom @%s", context->response_file);
-#endif
+ sprintf(cmdline, "%s @%s", DOOM_BINARY, context->response_file);
// Run the command
system(cmdline);