foxygit / doom Log in
commit da4d5c225390d1864b4c103bf76dcf6ba7238659
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Tue Oct 24 22:26:20 2006 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Tue Oct 24 22:26:20 2006 +0000

    Don't rely on INSTALL_DIR for the Win32 build.

    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 735
---
 setup/execute.c | 14 ++++++++------
 1 file 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);