I'm not really sure why that was failing, but let's copy the binpath just in case...
This commit is contained in:
parent
3cef9d05e8
commit
9ef1d2ed66
@ -311,7 +311,7 @@ static void findInterpreter(char * argv[]) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (binpath) {
|
if (binpath) {
|
||||||
vm.binpath = binpath;
|
vm.binpath = strdup(binpath);
|
||||||
} /* Else, give up at this point and just don't attach it at all. */
|
} /* Else, give up at this point and just don't attach it at all. */
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
2
src/vm.c
2
src/vm.c
@ -1193,7 +1193,7 @@ void krk_initVM(int flags) {
|
|||||||
krk_attachNamedValue(&vm.system->fields, "module_paths", module_paths);
|
krk_attachNamedValue(&vm.system->fields, "module_paths", module_paths);
|
||||||
krk_writeValueArray(AS_LIST(module_paths), OBJECT_VAL(S("./")));
|
krk_writeValueArray(AS_LIST(module_paths), OBJECT_VAL(S("./")));
|
||||||
if (vm.binpath) {
|
if (vm.binpath) {
|
||||||
krk_attachNamedObject(&vm.system->fields, "executable_path", (KrkObj*)krk_takeString(vm.binpath, strlen(vm.binpath)));
|
krk_attachNamedObject(&vm.system->fields, "executable_path", (KrkObj*)krk_copyString(vm.binpath, strlen(vm.binpath)));
|
||||||
char * dir = strdup(vm.binpath);
|
char * dir = strdup(vm.binpath);
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
char * slash = strrchr(dir,'/');
|
char * slash = strrchr(dir,'/');
|
||||||
|
Loading…
Reference in New Issue
Block a user