Project

General

Profile

Backport #5099 ยป ruby-1.9.2-p290-load-path-backport.diff

Backport patch against ruby-1.9.2-p290 - cwgem (Chris White), 08/04/2011 03:09 AM

View differences:

ruby-1.9.2-p290/load.c 2011-08-03 11:00:30.000000000 -0700
int type, VALUE load_path)
{
long i;
long plen;
const char *e;
if(vlen < len) return 0;
if (!strncmp(name+(vlen-len),feature,len)){
plen = vlen - len - 1;
} else {
for (e = name + vlen; name != e && *e != '.' && *e != '/'; --e);
if (*e!='.' ||
e-name < len ||
strncmp(e-len,feature,len) )
return 0;
plen = e - name - len - 1;
}
for (i = 0; i < RARRAY_LEN(load_path); ++i) {
VALUE p = RARRAY_PTR(load_path)[i];
const char *s = StringValuePtr(p);
long n = RSTRING_LEN(p);
if (vlen < n + len + 1) continue;
if (n != plen ) continue;
if (n && (strncmp(name, s, n) || name[n] != '/')) continue;
if (strncmp(name + n + 1, feature, len)) continue;
if (name[n+len+1] && name[n+len+1] != '.') continue;
switch (type) {
case 's':
if (IS_DLEXT(&name[n+len+1])) return p;
    (1-1/1)