0.7.12.46:
authorChristophe Rhodes <csr21@cam.ac.uk>
Wed, 19 Feb 2003 13:16:20 +0000 (13:16 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Wed, 19 Feb 2003 13:16:20 +0000 (13:16 +0000)
Probably last contrib frob in this release cycle
... ensure that SBCL_HOME is set even if an explicit core is
specified.
The intent behind this change is to make
sbcl --core /usr/lib/sbcl/sbcl.core
identical in effect to
sbcl
so that both invokations can continue to find contrib
packages in /usr/lib/sbcl/<foo>/

src/runtime/runtime.c
version.lisp-expr

index 908bd8c..b4a8f16 100644 (file)
@@ -15,6 +15,7 @@
 
 #include <stdio.h>
 #include <string.h>
+#include <libgen.h>
 #include <sys/types.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -282,6 +283,22 @@ main(int argc, char *argv[], char *envp[])
        if (!core) {
            lose("can't find core file");
        }
+    } else {
+       /* If a core was specified and SBCL_HOME is unset, set it */
+       char *sbcl_home = getenv("SBCL_HOME");
+       if (!sbcl_home) {
+           char *envstring, *copied_core, *dir;
+           char *stem = "SBCL_HOME=";
+           copied_core = copied_string(core);
+           dir = dirname(copied_core);
+           envstring = (char *) calloc(strlen(stem) +
+                                       strlen(dir) + 
+                                       1,
+                                       sizeof(char));
+           sprintf(envstring, "%s%s", stem, dir);
+           putenv(envstring);
+           free(copied_core);
+       }
     }
 
     if (!noinform) {
index 63abc7d..4d28c3f 100644 (file)
@@ -18,4 +18,4 @@
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
 
-"0.7.12.45"
+"0.7.12.46"