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:
parent
5929508198
commit
471ed04790
1 changed files with 4 additions and 0 deletions
|
@ -302,6 +302,10 @@ alpm_list_t SYMEXPORT *alpm_list_remove(alpm_list_t *haystack, const void *needl
|
|||
*data = NULL;
|
||||
}
|
||||
|
||||
if(needle == NULL) {
|
||||
return(haystack);
|
||||
}
|
||||
|
||||
while(i) {
|
||||
if(i->data == NULL) {
|
||||
continue;
|
||||
|
|
Loading…
Add table
Reference in a new issue