ref: da4d5c225390d1864b4c103bf76dcf6ba7238659
parent: f25e3e2d6ee2be725eade97fef60e615ff7f7177
author: Simon Howard <[email protected]>
date: Tue Oct 24 18:26:20 EDT 2006
Don't rely on INSTALL_DIR for the Win32 build. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 735
--- 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 @@
// 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);