[前][次][番号順一覧][スレッド一覧]

ruby-changes:9118

From: nobu <ko1@a...>
Date: Fri, 12 Dec 2008 11:02:02 +0900 (JST)
Subject: [ruby-changes:9118] Ruby:r20655 (trunk): * load.c (rb_feature_p): load path must be expanded.

nobu	2008-12-12 11:00:55 +0900 (Fri, 12 Dec 2008)

  New Revision: 20655

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=20655

  Log:
    * load.c (rb_feature_p): load path must be expanded.
      [ruby-dev:37388]

  Modified files:
    trunk/ChangeLog
    trunk/load.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 20654)
+++ ChangeLog	(revision 20655)
@@ -1,3 +1,14 @@
+Fri Dec 12 11:00:52 2008  Nobuyoshi Nakada  <nobu@r...>
+
+	* load.c (rb_feature_p): load path must be expanded.
+	  [ruby-dev:37388]
+
+Fri Dec 12 10:28:08 2008  Nobuyoshi Nakada  <nobu@r...>
+
+	* configure.in (rb_version): greps only the line that defines version.
+
+	* version.h (RUBY_VERSION_CODE, RUBY_RELEASE_CODE): removed.
+
 Fri Dec 12 10:20:55 2008  Nobuyoshi Nakada  <nobu@r...>
 
 	* complex.c, rational.c: do not use RUBY_VERSION_CODE.
Index: load.c
===================================================================
--- load.c	(revision 20654)
+++ load.c	(revision 20655)
@@ -33,6 +33,22 @@
     return load_path;
 }
 
+VALUE
+rb_get_expanded_load_path(void)
+{
+    VALUE load_path = rb_get_load_path();
+    VALUE ary = rb_ary_new2(RARRAY_LEN(load_path));
+    long i;
+
+    for (i = 0; i < RARRAY_LEN(load_path); ++i) {
+	VALUE path = rb_file_expand_path(RARRAY_PTR(load_path)[i], Qnil);
+	rb_str_freeze(path);
+	rb_ary_push(ary, path);
+    }
+    rb_obj_freeze(ary);
+    return ary;
+}
+
 static VALUE
 load_path_getter(ID id, rb_vm_t *vm)
 {
@@ -128,9 +144,10 @@
 	if ((n = RSTRING_LEN(v)) < len) continue;
 	if (strncmp(f, feature, len) != 0) {
 	    if (expanded) continue;
-	    if (!load_path) load_path = rb_get_load_path();
+	    if (!load_path) load_path = rb_get_expanded_load_path();
 	    if (!(p = loaded_feature_path(f, n, feature, len, type, load_path)))
 		continue;
+	    expanded = 1;
 	    f += RSTRING_LEN(p) + 1;
 	}
 	if (!*(e = f + len)) {

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]