[pacman-dev] [PATCH] _alpm_depmiss_isin fix

Xavier shiningxc at gmail.com
Wed Oct 24 17:58:45 EDT 2007


On Wed, Oct 24, 2007 at 10:58:34PM +0200, Nagy Gabor wrote:
> ---
>  lib/libalpm/deps.c |    7 +++++--
>  1 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c
> index b7e49be..69c675c 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))) {

Could someone explain what these two lines are supposed to do, because it
doesn't make any sense to me. The second line looks redundant.

Also I fail to see any real cases where this function would return true.
Though it's easy to trigger it with a simple pactest, where a package has the
same dependency listed twice. That doesn't make any sense but well...
This check probably doesn't hurt.




More information about the pacman-dev mailing list