Skip to content

Commit

Permalink
Fix foreach modcall. It was spinning infinitely.
Browse files Browse the repository at this point in the history
  • Loading branch information
skids committed Jun 14, 2013
1 parent 59fe3ca commit eee057b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/modcall.c
Expand Up @@ -555,6 +555,11 @@ int modcall(int component, modcallable *c, REQUEST *request)
RDEBUG2("%.*sforeach %s {",
stack.pointer + 1, modcall_spaces,
child->name);
if (vp) {
paircursor(&cursor, &vp);
/* Prime the cursor. */
cursor.found = cursor.current;
}
while (vp) {
VALUE_PAIR *copy = NULL, **copy_p;

Expand All @@ -580,9 +585,7 @@ int modcall(int component, modcallable *c, REQUEST *request)
if (myresult == MOD_ACTION_RETURN) {
break;
}
paircursor(&cursor, &vp);
vp = pairfindnext(&cursor, vp->da->attr, vp->da->vendor, TAG_ANY);

/*
* Delete the cached attribute,
* if it exists.
Expand Down

0 comments on commit eee057b

Please sign in to comment.