Fix am_cache_env_fetch_first.

This function is supposed to return the value of the entry we are
looking for, but instead it returned the name. Fix it to return the
value.

Also, fix exit condition on for-loop.

This fixes NameID-based logout.
This commit is contained in:
Olav Morken 2014-08-27 15:27:30 +02:00
parent 22990058be
commit 7a24e4be0c
1 changed files with 2 additions and 2 deletions

View File

@ -489,12 +489,12 @@ const char *am_cache_env_fetch_first(am_cache_entry_t *t,
const char *str;
int i;
for (i = 0; t->size; i++) {
for (i = 0; i < t->size; i++) {
str = am_cache_entry_get_string(t, &t->env[i].varname);
if (str == NULL)
break;
if (strcmp(str, var) == 0)
return str;
return am_cache_entry_get_string(t, &t->env[i].value);
}
return NULL;