summaryrefslogtreecommitdiff
path: root/lib/libalpm
diff options
context:
space:
mode:
authorNagy Gabor <ngaba@bibl.u-szeged.hu>2007-10-24 22:58:34 +0200
committerDan McGee <dan@archlinux.org>2007-10-24 16:51:12 -0500
commit89ac8aa9c45486aa4f4b9599bb094f1d54ff1b66 (patch)
tree7fb99506c99c674a7110f54e3b0423f401f4e097 /lib/libalpm
parent581769b72d882fdc05bdbdc588db97187329e5b5 (diff)
_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>
Diffstat (limited to 'lib/libalpm')
-rw-r--r--lib/libalpm/deps.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c
index b7e49be2..69c675cd 100644
--- a/lib/libalpm/deps.c
+++ b/lib/libalpm/deps.c
@@ -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);
}
}