Skip to content

Commit

Permalink
Only use libpath prepended file if it exists.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Oct 5, 2013
1 parent b674414 commit 067a66e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/loadbytecode.c
Expand Up @@ -35,7 +35,11 @@ static MVMString * figure_filename(MVMThreadContext *tc, MVMString *orig) {
else {
memcpy(new_path + lib_path_len, orig_cstr, orig_len);
}
result = MVM_string_utf8_decode(tc, tc->instance->VMString, new_path, new_len);
MVMROOT(tc, orig, {
result = MVM_string_utf8_decode(tc, tc->instance->VMString, new_path, new_len);
if (!MVM_file_exists(tc, result))
result = orig;
});
free(new_path);
return result;
}
Expand Down

0 comments on commit 067a66e

Please sign in to comment.