From a9277c71fd734ece4b78f8e915f49cf547709c23 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Wed, 21 Jan 2009 18:07:26 -0600 Subject: [PATCH] fix macosx initialization of executable_path --- vm/factor.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vm/factor.c b/vm/factor.c index b3020e3171..d9042c9455 100755 --- a/vm/factor.c +++ b/vm/factor.c @@ -53,8 +53,7 @@ INLINE bool factor_arg(const F_CHAR* str, const F_CHAR* arg, CELL* value) void init_parameters_from_args(F_PARAMETERS *p, int argc, F_CHAR **argv) { default_parameters(p); - const F_CHAR *executable_path = vm_executable_path(); - p->executable_path = executable_path ? executable_path : argv[0]; + p->executable_path = argv[0]; int i = 0; @@ -106,6 +105,11 @@ void init_factor(F_PARAMETERS *p) /* OS-specific initialization */ early_init(); + const F_CHAR *executable_path = vm_executable_path(); + + if(executable_path) + p->executable_path = executable_path; + if(p->image_path == NULL) p->image_path = default_image_path();