hash.c:1590
static VALUE
env_index(dmy, value)
    VALUE dmy, value;
{
    char **env;
    VALUE str;

    StringValue(value);
    env = GET_ENVIRON(environ);
    while (*env) {
	char *s = strchr(*env, '=');
	if (s++) {
#ifdef ENV_IGNORECASE
	    if (strncasecmp(s, RSTRING(value)->ptr, strlen(s)) == 0) {
#else
	    if (strncmp(s, RSTRING(value)->ptr, strlen(s)) == 0) {
#endif
		str = env_str_new(*env, s-*env-1);
		FREE_ENVIRON(environ);
		return str;
	    }
	}
	env++;
    }
    FREE_ENVIRON(environ);
    return Qnil;
}
