In message "Re: [BUG] autoload"
    on Mon, 1 Nov 2004 04:10:45 +0900, nobu.nokada / softhome.net writes:
|
|Hi,
|
|At Sun, 31 Oct 2004 22:28:30 +0900,
|ts wrote in [ruby-core:03661]:
|> J> Something has changed in 1.9 snapshots in the last week that is breaking 
|> J> my autoloads.
|> 
|>  This is this [ruby-list:40085]
|
|Sorry, I forgot to modify rb_provided().

Here's mine:

--- eval.c	30 Oct 2004 06:56:17 -0000	1.723
+++ eval.c	31 Oct 2004 19:24:34 -0000
@@ -6625,3 +6625,17 @@ rb_provided(feature)
 {
-    return rb_feature_p(feature, 0, Qfalse) ? Qtrue : Qfalse;
+    int i;
+    char *buf;
+
+    if (rb_feature_p(feature, 0, Qfalse))
+	return Qtrue;
+    if (!loading_tbl) return Qfalse;
+    if (st_lookup(loading_tbl, (st_data_t)feature, 0)) return Qtrue;
+    buf = ALLOCA_N(char, strlen(feature)+8);
+    strcpy(buf, feature);
+    for (i=0; ; i++) {
+	if (!loadable_ext[i]) break;
+	strcpy(buf+strlen(feature), loadable_ext[i]);
+	if (st_lookup(loading_tbl, (st_data_t)buf, 0)) return Qtrue;
+    }
+    return Qfalse;
 }