[#3479] Missing .document files for ext/ libraries — Brian Candler <B.Candler@...>

The ri documentation for zlib, strscan and iconv doesn't get built by 'make

12 messages 2004/10/06

[#3492] Re: ANN: Free-form-operators patch — Markus <markus@...>

> In message "Re: ANN: Free-form-operators patch"

15 messages 2004/10/11
[#3493] Re: ANN: Free-form-operators patch — Yukihiro Matsumoto <matz@...> 2004/10/11

Hi,

[#3495] Re: ANN: Free-form-operators patch — Markus <markus@...> 2004/10/12

On Mon, 2004-10-11 at 16:16, Yukihiro Matsumoto wrote:

[#3561] 1.8.2 - what can we do to help? — Dave Thomas <dave@...>

Folks:

23 messages 2004/10/26
[#3562] Re: 1.8.2 - what can we do to help? — Yukihiro Matsumoto <matz@...> 2004/10/27

Hi,

Re: [BUG] autoload

From: nobu.nokada@...
Date: 2004-10-31 19:10:45 UTC
List: ruby-core #3668
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().

# BTW, I'll be absent till next monday and off-line, so cannot
# reply, commit and so on.


* eval.c (rb_feature_p): check also loading_tbl.  [ruby-core:03655]


Index: eval.c
===================================================================
RCS file: /cvs/ruby/src/ruby/eval.c,v
retrieving revision 1.723
diff -U2 -p -d -r1.723 eval.c
--- eval.c	30 Oct 2004 06:56:17 -0000	1.723
+++ eval.c	31 Oct 2004 17:10:10 -0000
@@ -6576,4 +6576,41 @@ static st_table *loading_tbl;
 #endif
 
+struct loading_feature_arg {
+    const char *result, *feature, *ext;
+    int rb;
+    long len, elen;
+};
+
+static int
+loading_feature_p(key, value, arg)
+    st_data_t key, value, arg;
+{
+    struct loading_feature_arg *p = (struct loading_feature_arg *)arg;
+    const char *f = (char *)key;
+    const char *feature = p->feature;
+    const char *ext = p->ext;
+    int rb = p->rb;
+    long len = p->len;
+    long elen = p->elen;
+    const char *e;
+
+    if (strncmp(f, feature, len) != 0) return ST_CONTINUE;
+    if (!*(e = f + len)) {
+	if (ext) return ST_CONTINUE;
+	p->result = e;
+	return ST_STOP;
+    }
+    if (*e != '.') return ST_CONTINUE;
+    if ((!rb || !ext) && (IS_SOEXT(e) || IS_DLEXT(e))) {
+	p->result = e;
+	return ST_STOP;
+    }
+    if ((rb || !ext) && (strcmp(e, ".rb") == 0)) {
+	p->result = e;
+	return ST_STOP;
+    }
+    return ST_CONTINUE;
+}
+
 static char *
 rb_feature_p(feature, ext, rb)
@@ -6608,4 +6645,15 @@ rb_feature_p(feature, ext, rb)
 	    return e;
 	}
+    }
+    if (loading_tbl) {
+	struct loading_feature_arg arg;
+	arg.result = 0;
+	arg.feature = feature;
+	arg.ext = ext;
+	arg.rb = rb;
+	arg.len = len;
+	arg.elen = elen;
+	st_foreach(loading_tbl, loading_feature_p, (st_data_t)&arg);
+	return (char *)arg.result;
     }
     return 0;


-- 
Nobu Nakada

In This Thread