char *stem = "/sbcl.core";
char *core;
- if(!sbcl_home) sbcl_home = SBCL_HOME;
+ if (!(sbcl_home && *sbcl_home)) sbcl_home = SBCL_HOME;
lookhere = (char *) calloc(strlen(sbcl_home) +
strlen(stem) +
1,
return core;
}
- \f
+char **posix_argv;
+char *core_string;
+
+\f
int
main(int argc, char *argv[], char *envp[])
{
boolean end_runtime_options = 0;
lispobj initial_function;
+ const char *sbcl_home = getenv("SBCL_HOME");
interrupt_init();
block_blockable_signals();
}
/* Align down to multiple of page_table page size */
- dynamic_space_size = (dynamic_space_size/PAGE_BYTES) * PAGE_BYTES;
+ dynamic_space_size &= ~(PAGE_BYTES - 1);
/* KLUDGE: os_vm_page_size is set by os_init(), and on some
* systems (e.g. Alpha) arch_init() needs need os_vm_page_size, so
}
}
- /* Make sure that SBCL_HOME is set, unless loading an embedded core. */
- if (!getenv("SBCL_HOME") && embedded_core_offset == 0) {
+ /* Make sure that SBCL_HOME is set and not the empty string,
+ unless loading an embedded core. */
+ if (!(sbcl_home && *sbcl_home) && embedded_core_offset == 0) {
char *envstring, *copied_core, *dir;
char *stem = "SBCL_HOME=";
copied_core = copied_string(core);
free(copied_core);
}
- if (!noinform) {
+ if (!noinform && embedded_core_offset == 0) {
print_banner();
fflush(stdout);
}
wos_install_interrupt_handlers(&exception_frame);
#endif
- /* Pass core filename into Lisp */
- SetSymbolValue(CORE_STRING, alloc_base_string(core),0);
- SHOW("freeing core");
- free(core);
-
- /* Convert remaining argv values to something that Lisp can grok. */
- SHOW("setting POSIX-ARGV symbol value");
- SetSymbolValue(POSIX_ARGV, alloc_base_string_list(sbcl_argv),0);
- free(sbcl_argv);
+ /* Pass core filename and the processed argv into Lisp. They'll
+ * need to be processed further there, to do locale conversion.
+ */
+ core_string = core;
+ posix_argv = sbcl_argv;
FSHOW((stderr, "/funcalling initial_function=0x%lx\n",
(unsigned long)initial_function));