summaryrefslogtreecommitdiff
path: root/load.c
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-20 15:14:51 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-20 15:14:51 +0000
commit88d0a18c9fa3cfce8db9ee3fadc0cc15ee5730fe (patch)
tree21f5468da61250046ebd723248501792059418f2 /load.c
parentc1ca05af16a960a2431cf7afbbae9c034147899a (diff)
merge revision(s) 40135,40148,40173: [Backport #8165]
* load.c (features_index_add): use rb_str_subseq() to specify C string position properly to fix require non ascii path. [ruby-core:53733] [Bug #8165] * test/ruby/test_require.rb (TestRequire#test_require_nonascii_path): a test for the above. * test/ruby/test_require.rb (TestRequire#test_require_nonascii_path): fix load path for encoding to run the test as stand-alone. * test/ruby/test_require.rb (TestRequire#test_require_nonascii_path): RUBY_PLATFORM should escape as Regexp, because RUBY_PLATFORM may contain '.'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@40398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'load.c')
-rw-r--r--load.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/load.c b/load.c
index 72cab598d2..498e7e9990 100644
--- a/load.c
+++ b/load.c
@@ -247,16 +247,16 @@ features_index_add(VALUE feature, VALUE offset)
if (p < feature_str)
break;
/* Now *p == '/'. We reach this point for every '/' in `feature`. */
- short_feature = rb_str_substr(feature, p + 1 - feature_str, feature_end - p - 1);
+ short_feature = rb_str_subseq(feature, p + 1 - feature_str, feature_end - p - 1);
features_index_add_single(short_feature, offset);
if (ext) {
- short_feature = rb_str_substr(feature, p + 1 - feature_str, ext - p - 1);
+ short_feature = rb_str_subseq(feature, p + 1 - feature_str, ext - p - 1);
features_index_add_single(short_feature, offset);
}
}
features_index_add_single(feature, offset);
if (ext) {
- short_feature = rb_str_substr(feature, 0, ext - feature_str);
+ short_feature = rb_str_subseq(feature, 0, ext - feature_str);
features_index_add_single(short_feature, offset);
}
}