Skip to content

Commit

Permalink
Merge pull request #3 from kuroko-lang/master
Browse files Browse the repository at this point in the history
Resync to upstream.
  • Loading branch information
HarJIT authored Feb 16, 2021
2 parents 955fb82 + 9ef1d2e commit 4606492
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/kuroko.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ static void findInterpreter(char * argv[]) {
}
}
if (binpath) {
vm.binpath = binpath;
vm.binpath = strdup(binpath);
} /* Else, give up at this point and just don't attach it at all. */
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion src/vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,7 @@ void krk_initVM(int flags) {
krk_attachNamedValue(&vm.system->fields, "module_paths", module_paths);
krk_writeValueArray(AS_LIST(module_paths), OBJECT_VAL(S("./")));
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);
#ifndef _WIN32
char * slash = strrchr(dir,'/');
Expand Down

0 comments on commit 4606492

Please sign in to comment.