summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-13 02:16:20 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-13 02:16:20 +0000
commit06fa07662b5bde275850db01f4302a669b87bb2e (patch)
tree35e1052eaf2a7b76d16cda85d488e9fe9aa31f52
parentd9fe7ef4924d0e30a0de4ca7ee9c45638b8ebcb4 (diff)
* load.c (rb_get_expanded_load_path): expand paths if any item in $:
is not a string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--load.c6
2 files changed, 7 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 2fc08daacb..0c20d1b932 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Mar 13 11:14:26 2010 Shugo Maeda <shugo@ruby-lang.org>
+
+ * load.c (rb_get_expanded_load_path): expand paths if any item in $:
+ is not a string.
+
Sat Mar 13 10:16:32 2010 Shugo Maeda <shugo@ruby-lang.org>
* load.c (rb_get_expanded_load_path): does not expand paths if all
diff --git a/load.c b/load.c
index 5f69fd3d56..95be55ff67 100644
--- a/load.c
+++ b/load.c
@@ -41,10 +41,8 @@ rb_get_expanded_load_path(void)
long i;
for (i = 0; i < RARRAY_LEN(load_path); ++i) {
- VALUE str = RARRAY_PTR(load_path)[i];
- if (TYPE(str) != T_STRING)
- RB_GC_GUARD(str) = rb_get_path(str);
- if (!rb_is_absolute_path(RSTRING_PTR(str)))
+ VALUE str = rb_check_string_type(RARRAY_PTR(load_path)[i]);
+ if (NIL_P(str) || !rb_is_absolute_path(RSTRING_PTR(str)))
goto relative_path_found;
}
return load_path;