Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use st_lookup instead of st_delete, and emulate search_required behavior
  • Loading branch information
tmm1 committed Feb 12, 2015
commit 1089cf1f707ca22c5fb7ad53271e5aafc89994bc
4 changes: 2 additions & 2 deletions load.c
Original file line number Diff line number Diff line change
Expand Up @@ -980,14 +980,14 @@ rb_require_safe(VALUE fname, int safe)
ipath = rb_str_encode_ospath(fname);
if (vm->require_cache.read && RSTRING_PTR(ipath)[0] != '/') {
key = (st_data_t)RSTRING_PTR(ipath);
if (st_delete(vm->require_cache.tbl, &key, &val)) {
if (st_lookup(vm->require_cache.tbl, key, &val)) {
vals = (char *)val;
found = vals[0];
if (found) {
/*fprintf(stderr, "FOUND '%s' => '%s'\n", (char *)key, vals);*/
path = rb_str_new_cstr(vals+1);
vals[1] = 0;
}
xfree(vals);
} else {
found = search_required(ipath, &path, safe);
/*if (found && path)
Expand Down