1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* enumerator.c (Init_Enumerator): provided features should have

extensions.

* eval.c (rb_feature_p): returns type of the feature instead of
  extension.

* eval.c (search_required): ruby library should be prior to statically
  linked extentions.  fixed: [ruby-dev:26711]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2005-08-04 15:09:03 +00:00
parent 4fd5436b32
commit c83d6db61b
3 changed files with 25 additions and 15 deletions

View file

@ -1,3 +1,14 @@
Fri Aug 5 00:08:44 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* enumerator.c (Init_Enumerator): provided features should have
extensions.
* eval.c (rb_feature_p): returns type of the feature instead of
extension.
* eval.c (search_required): ruby library should be prior to statically
linked extentions. fixed: [ruby-dev:26711]
Thu Aug 4 20:03:18 2005 Tadashi Saito <shiba@mail2.accsnet.ne.jp> Thu Aug 4 20:03:18 2005 Tadashi Saito <shiba@mail2.accsnet.ne.jp>
* numeric.c (Init_Numeric): do not share implementation among * numeric.c (Init_Numeric): do not share implementation among
@ -11,10 +22,10 @@ Thu Aug 4 18:38:36 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/stubs.c: ditto. * ext/tk/stubs.c: ditto.
* ext/tk/lib/tk.rb: forgot to define TclTkIp.encoding and encoding= * ext/tk/lib/tk.rb: forgot to define TclTkIp.encoding and encoding=
when Tcl is 7.6 or 8.0. when Tcl is 7.6 or 8.0.
* ext/tk/lib/tk/wm.rb: support to make some methods as options of * ext/tk/lib/tk/wm.rb: support to make some methods as options of
root or toplevel widget. [ruby-talk:150336] root or toplevel widget. [ruby-talk:150336]
* ext/tk/lib/tk/root.rb: ditto. * ext/tk/lib/tk/root.rb: ditto.

View file

@ -426,5 +426,5 @@ Init_Enumerator()
sym_each_slice = ID2SYM(rb_intern("each_slice")); sym_each_slice = ID2SYM(rb_intern("each_slice"));
sym_each_cons = ID2SYM(rb_intern("each_cons")); sym_each_cons = ID2SYM(rb_intern("each_cons"));
rb_provide("enumerator"); /* for backward compatibility */ rb_provide("enumerator.so"); /* for backward compatibility */
} }

23
eval.c
View file

@ -6850,7 +6850,7 @@ static st_table *loading_tbl;
#define IS_DLEXT(e) (strcmp(e, DLEXT) == 0) #define IS_DLEXT(e) (strcmp(e, DLEXT) == 0)
#endif #endif
static char * static int
rb_feature_p(feature, ext, rb) rb_feature_p(feature, ext, rb)
const char *feature, *ext; const char *feature, *ext;
int rb; int rb;
@ -6873,14 +6873,14 @@ rb_feature_p(feature, ext, rb)
if (strncmp(f, feature, len) != 0) continue; if (strncmp(f, feature, len) != 0) continue;
if (!*(e = f + len)) { if (!*(e = f + len)) {
if (ext) continue; if (ext) continue;
return e; return 'u';
} }
if (*e != '.') continue; if (*e != '.') continue;
if ((!rb || !ext) && (IS_SOEXT(e) || IS_DLEXT(e))) { if ((!rb || !ext) && (IS_SOEXT(e) || IS_DLEXT(e))) {
return e; return 's';
} }
if ((rb || !ext) && (strcmp(e, ".rb") == 0)) { if ((rb || !ext) && (strcmp(e, ".rb") == 0)) {
return e; return 'r';
} }
} }
return 0; return 0;
@ -6990,7 +6990,7 @@ search_required(fname, path)
{ {
VALUE tmp; VALUE tmp;
char *ext, *ftptr; char *ext, *ftptr;
int type; int type, ft = 0;
*path = 0; *path = 0;
ext = strrchr(ftptr = RSTRING(fname)->ptr, '.'); ext = strrchr(ftptr = RSTRING(fname)->ptr, '.');
@ -7041,8 +7041,8 @@ search_required(fname, path)
} }
} }
} }
else if (ext = rb_feature_p(ftptr, 0, Qfalse)) { else if ((ft = rb_feature_p(ftptr, 0, Qfalse)) == 'r') {
return (*ext && (IS_SOEXT(ext) || IS_DLEXT(ext))) ? 's' : 'r'; return 'r';
} }
tmp = fname; tmp = fname;
type = rb_find_file_ext(&tmp, loadable_ext); type = rb_find_file_ext(&tmp, loadable_ext);
@ -7050,13 +7050,12 @@ search_required(fname, path)
switch (type) { switch (type) {
case 0: case 0:
ftptr = RSTRING(tmp)->ptr; ftptr = RSTRING(tmp)->ptr;
if ((ext = rb_feature_p(ftptr, 0, Qfalse))) { if (ft) break;
type = strcmp(".rb", ext); return rb_feature_p(ftptr, 0, Qfalse);
break;
}
return 0;
default: default:
if (ft) break;
case 1:
ext = strrchr(ftptr = RSTRING(tmp)->ptr, '.'); ext = strrchr(ftptr = RSTRING(tmp)->ptr, '.');
if (rb_feature_p(ftptr, ext, !--type)) break; if (rb_feature_p(ftptr, ext, !--type)) break;
*path = tmp; *path = tmp;