- } 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);
- }