alpm_list_remove treat NULL needle as "nothing"

So if you want to remove NULL needle from a list, alpm_list_remove will
return with "not found".

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Nagy Gabor 2008-07-16 15:57:08 +02:00 committed by Dan McGee
parent 5929508198
commit 471ed04790

View file

@ -302,6 +302,10 @@ alpm_list_t SYMEXPORT *alpm_list_remove(alpm_list_t *haystack, const void *needl
*data = NULL; *data = NULL;
} }
if(needle == NULL) {
return(haystack);
}
while(i) { while(i) {
if(i->data == NULL) { if(i->data == NULL) {
continue; continue;