[pacman-dev] [patch]Bug in cache.c

Nagy Gabor ngaba at petra.hos.u-szeged.hu
Fri Mar 9 15:30:28 EST 2007


Hi!
I think that this is a bug but accidentally works because the name
entry is the first member of pmgrp_t.

--- cache.c.old	2007-03-09 21:21:29.000000000 +0100
+++ cache.c	2007-03-09 21:21:15.000000000 +0100
@@ -214,7 +214,7 @@
 																						 /* gross signature forces us to
 																							* discard const */
 																						 (void *)alpm_pkg_get_name(pkg),
-																						 _alpm_grp_cmp);
+																						 strcmp);
 				db->grpcache = alpm_list_add_sorted(db->grpcache, grp, _alpm_grp_cmp);
 			} else {
 				alpm_list_t *j;
@@ -225,7 +225,7 @@
 					if(strcmp(grp->name, i->data) == 0) {
 						const char *pkgname = alpm_pkg_get_name(pkg);
 						if(!alpm_list_find_str(grp->packages, pkgname)) {
-							grp->packages = alpm_list_add_sorted(grp->packages, (void *)pkgname, _alpm_grp_cmp);
+							grp->packages = alpm_list_add_sorted(grp->packages, (void *)pkgname, strcmp);
 						}
 					}
 				}




More information about the pacman-dev mailing list