diff options
author | shirosaki <shirosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-04-05 15:30:52 +0000 |
---|---|---|
committer | shirosaki <shirosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-04-05 15:30:52 +0000 |
commit | 07636ed42ebc9b690846813b492d75bcf32bb62c (patch) | |
tree | 941f1b3341ff8fb5ff227f7d5fd1309b4986688b /load.c | |
parent | 21d47b7381ae6da9e6ffe1aa288b295af8e3b3d1 (diff) | |
download | bundler-07636ed42ebc9b690846813b492d75bcf32bb62c.tar.gz |
* 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.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'load.c')
-rw-r--r-- | load.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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); } } |