summaryrefslogtreecommitdiff
path: root/load.c
diff options
context:
space:
mode:
Diffstat (limited to 'load.c')
-rw-r--r--load.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/load.c b/load.c
index 9b258b7657..9272bdba01 100644
--- a/load.c
+++ b/load.c
@@ -94,15 +94,6 @@ rb_construct_expanded_load_path(enum expand_type type, int *has_relative, int *h
rb_ary_replace(vm->load_path_snapshot, vm->load_path);
}
-static VALUE
-load_path_getcwd(void)
-{
- char *cwd = my_getcwd();
- VALUE cwd_str = rb_filesystem_str_new_cstr(cwd);
- xfree(cwd);
- return cwd_str;
-}
-
VALUE
rb_get_expanded_load_path(void)
{
@@ -114,7 +105,7 @@ rb_get_expanded_load_path(void)
int has_relative = 0, has_non_cache = 0;
rb_construct_expanded_load_path(EXPAND_ALL, &has_relative, &has_non_cache);
if (has_relative) {
- vm->load_path_check_cache = load_path_getcwd();
+ vm->load_path_check_cache = rb_dir_getwd_ospath();
}
else if (has_non_cache) {
/* Non string object. */
@@ -132,7 +123,7 @@ rb_get_expanded_load_path(void)
}
else if (vm->load_path_check_cache) {
int has_relative = 1, has_non_cache = 1;
- VALUE cwd = load_path_getcwd();
+ VALUE cwd = rb_dir_getwd_ospath();
if (!rb_str_equal(vm->load_path_check_cache, cwd)) {
/* Current working directory or filesystem encoding was changed.
Expand relative load path and non-cacheable objects again. */