Skip to content

Commit

Permalink
Merge pull request #809 from Feh/pairadd-ignore-dups
Browse files Browse the repository at this point in the history
pairadd: Don't add a VP if it's already present
  • Loading branch information
alandekok committed Oct 9, 2014
2 parents 589ef23 + b73a4c5 commit 21391a4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/valuepair.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,11 @@ void pairadd(VALUE_PAIR **first, VALUE_PAIR *add)
*first = add;
return;
}
for(i = *first; i->next; i = i->next)
for(i = *first; i->next; i = i->next) {
VERIFY_VP(i);
if(i == add)
return;
}
i->next = add;
}

Expand Down

0 comments on commit 21391a4

Please sign in to comment.