1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-11-12 12:25:02 -05:00

_alpm_depmiss_isin fix

The old code used memcmp, which is not good for comparing strings:
"pkgname"'\0''\0' should be equal to "pkgname"'\0''a' for example.
The new code uses strcmp.

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Nagy Gabor 2007-10-24 22:58:34 +02:00 committed by Dan McGee
parent 581769b72d
commit 89ac8aa9c4

View File

@ -98,8 +98,11 @@ int _alpm_depmiss_isin(pmdepmissing_t *needle, alpm_list_t *haystack)
for(i = haystack; i; i = i->next) {
pmdepmissing_t *miss = i->data;
if(!memcmp(needle, miss, sizeof(pmdepmissing_t))
&& !memcmp(&needle->depend, &miss->depend, sizeof(pmdepend_t))) {
if(needle->type == miss->type &&
!strcmp(needle->target, miss->target) &&
needle->depend.mod == miss->depend.mod &&
!strcmp(needle->depend.name, miss->depend.name) &&
!strcmp(needle->depend.version, miss->depend.version)) {
return(1);
}
}