summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-09 06:46:31 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-09 06:46:31 +0000
commit31a6d508635815d24ced07c5a65273cb0fcf54de (patch)
tree4aa96fb05b18df3231f438cbee3231241fc38d8f
parentbc664b878c9992462f92e7f08fdd534dd08c69b3 (diff)
* load.c (rb_feature_provided): fixed for autoloading extension
library without suffix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--load.c4
-rw-r--r--test/ruby/test_autoload.rb12
3 files changed, 20 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index ad3dad7d08..2273b23dbc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,12 @@
+Wed Sep 9 15:46:28 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * load.c (rb_feature_provided): fixed for autoloading extension
+ library without suffix.
+
Wed Sep 9 15:24:32 2009 TAKANO Mitsuhiro (takano32) <tak@no32.tk>
* include/ruby/st.h : revert previous commit.
+
* ext/objspace/objspace.c : remove st_memsize declare.
Wed Sep 9 14:07:19 2009 TAKANO Mitsuhiro (takano32) <tak@no32.tk>
diff --git a/load.c b/load.c
index c58ebd8f6a..57d5f3a9b4 100644
--- a/load.c
+++ b/load.c
@@ -233,7 +233,7 @@ rb_feature_provided(const char *feature, const char **loading)
return FALSE;
}
}
- if (rb_feature_p(feature, feature + strlen(feature), TRUE, FALSE, loading))
+ if (rb_feature_p(feature, 0, TRUE, FALSE, loading))
return TRUE;
return FALSE;
}
@@ -473,7 +473,7 @@ search_required(VALUE fname, volatile VALUE *path, int safe_level)
OBJ_FREEZE(tmp);
if (rb_find_file_ext_safe(&tmp, loadable_ext + 1, safe_level)) {
ext = strrchr(ftptr = RSTRING_PTR(tmp), '.');
- if (!rb_feature_p(ftptr, ext, Qfalse, Qtrue, &loading) || loading)
+ if (!rb_feature_p(ftptr, ext, FALSE, TRUE, &loading) || loading)
*path = tmp;
return 's';
}
diff --git a/test/ruby/test_autoload.rb b/test/ruby/test_autoload.rb
new file mode 100644
index 0000000000..c2039086cf
--- /dev/null
+++ b/test/ruby/test_autoload.rb
@@ -0,0 +1,12 @@
+require 'test/unit'
+require_relative 'envutil'
+
+class TestAutoload < Test::Unit::TestCase
+ def test_autoload_so
+ # Continuation is always available, unless excluded intentionally.
+ assert_in_out_err([], <<-INPUT, [], [])
+ autoload :Continuation, "continuation"
+ begin Continuation; rescue LoadError; end
+ INPUT
+ end
+end