From b617f5270c610bf870e7267f9db3d32f93551611 Mon Sep 17 00:00:00 2001 From: eban Date: Mon, 25 Sep 2000 10:21:58 +0000 Subject: [PATCH] eban git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- eval.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/eval.c b/eval.c index b2e9deb4c0..4d5e719b19 100644 --- a/eval.c +++ b/eval.c @@ -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; }