diff options
| author | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-09-25 10:21:58 +0000 |
|---|---|---|
| committer | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-09-25 10:21:58 +0000 |
| commit | 51fd10f8a20be18833686741c29b8fa8dabfe069 (patch) | |
| tree | abbd93aa3b013eae4a06133aa1a87954961ddb1f | |
| parent | a027f984ce151863e25fb72b3b27a55c56fa068e (diff) | |
| download | ruby-51fd10f8a20be18833686741c29b8fa8dabfe069.tar.gz ruby-51fd10f8a20be18833686741c29b8fa8dabfe069.tar.xz ruby-51fd10f8a20be18833686741c29b8fa8dabfe069.zip | |
eban
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | eval.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -5027,7 +5027,6 @@ rb_feature_p(feature, wait) { VALUE *p, *pend; char *f; - int len; p = RARRAY(rb_features)->ptr; pend = p + RARRAY(rb_features)->len; @@ -5036,12 +5035,12 @@ rb_feature_p(feature, wait) if (strcmp(f, feature) == 0) { goto load_wait; } - len = strlen(f); if (strncmp(f, feature, strlen(feature)) == 0) { - if (strcmp(f+len, ".so") == 0) { + char *ext = strrchr(f, '.'); + if (strcmp(ext, ".so") == 0) { return Qtrue; } - if (strcmp(f+len, ".rb") == 0) { + if (strcmp(ext, ".rb") == 0) { if (wait) goto load_wait; return Qtrue; } |
