eval.c:5970
static int
search_required(fname, featurep, path)
    VALUE fname, *featurep, *path;
{
    VALUE tmp;
    char *ext, *ftptr;

    *featurep = fname;
    *path = 0;
    ext = strrchr(ftptr = RSTRING(fname)->ptr, '.');
    if (ext && !strchr(ext, '/')) {
	if (strcmp(".rb", ext) == 0) {
	    if (rb_feature_p(ftptr, ext, Qtrue)) return 'r';
	    if (*path = rb_find_file(fname)) return 'r';
	    return 0;
	}
	else if (IS_SOEXT(ext)) {
	    if (rb_feature_p(ftptr, ext, Qfalse)) return 's';
	    tmp = rb_str_new(RSTRING(fname)->ptr, ext-RSTRING(fname)->ptr);
	    *featurep = tmp;
#ifdef DLEXT2
	    if (rb_find_file_ext(&tmp, loadable_ext+1)) {
		*path = rb_find_file(tmp);
		return 's';
	    }
#else
	    rb_str_cat2(tmp, DLEXT);
	    if (*path = rb_find_file(tmp)) {
		return 's';
	    }
#endif
	}
	else if (IS_DLEXT(ext)) {
	    if (rb_feature_p(ftptr, ext, Qfalse)) return 's';
	    if (*path = rb_find_file(fname)) return 's';
	}
    }
    if ((ext = rb_feature_p(ftptr, 0, Qfalse)) != 0) {
	return strcmp(ext, ".rb") == 0 ? 'r' : 's';
    }
    tmp = fname;
    switch (rb_find_file_ext(&tmp, loadable_ext)) {
      case 0:
	return 0;

      case 1:
	*featurep = tmp;
	*path = rb_find_file(tmp);
	return 'r';

      default:
	*featurep = tmp;
	*path = rb_find_file(tmp);
	return 's';
    }
}
