summaryrefslogtreecommitdiff
path: root/load.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-09 07:16:31 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-09 07:16:31 +0000
commit4def2274b2685eab2c2a3bc4cd831faf1382e5e9 (patch)
treea1032822a5601832494371e659331a27d2b1065e /load.c
parent0d1f4fb57deeeb88f55751bf71ad7c2e90ac47b1 (diff)
merge revision(s) 50515: [Backport #11155]
* load.c (loaded_feature_path): stop returning false negatives for filenames which are trailing substrings of file extensions. For example, 'b', which a trailing substring of ".rb" should not return false. [Bug #11155][ruby-core:69206] * test/ruby/test_autoload.rb: test for fix git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@50805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'load.c')
-rw-r--r--load.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/load.c b/load.c
index e5014c165f..fe34b422ee 100644
--- a/load.c
+++ b/load.c
@@ -319,7 +319,7 @@ loaded_feature_path(const char *name, long vlen, const char *feature, long len,
const char *e;
if (vlen < len+1) return 0;
- if (!strncmp(name+(vlen-len), feature, len)) {
+ if (strchr(feature, '.') && !strncmp(name+(vlen-len), feature, len)) {
plen = vlen - len;
}
else {