From: Clemens Lang Date: Sat, 30 May 2015 19:56:22 +0000 (+0200) Subject: Fix incorrect comparison with multiple values X-Git-Tag: 0.6.12~51^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F90%2Fhead;p=thirdparty%2Flibsolv.git Fix incorrect comparison with multiple values a == X || Y is valid C, but does interesting things and probably not what you would expect. Luckily, clang warns for this kind of problem: warning: use of logical '||' with constant operand [-Wconstant-logical-operand] Fix this by using the proper comparison logic, which is a == X || a == Y Signed-off-by: Clemens Lang --- diff --git a/bindings/solv.i b/bindings/solv.i index 3481579d..1a44e2a2 100644 --- a/bindings/solv.i +++ b/bindings/solv.i @@ -2881,7 +2881,7 @@ rb_eval_string( %newobject Job; Job *Job() { Id extraflags = solver_solutionelement_extrajobflags($self->solv, $self->problemid, $self->solutionid); - if ($self->type == SOLVER_SOLUTION_JOB || SOLVER_SOLUTION_POOLJOB) + if ($self->type == SOLVER_SOLUTION_JOB || $self->type == SOLVER_SOLUTION_POOLJOB) return new_Job($self->solv->pool, SOLVER_NOOP, 0); if ($self->type == SOLVER_SOLUTION_INFARCH || $self->type == SOLVER_SOLUTION_DISTUPGRADE || $self->type == SOLVER_SOLUTION_BEST) return new_Job($self->solv->pool, SOLVER_INSTALL|SOLVER_SOLVABLE|SOLVER_NOTBYUSER|extraflags, $self->p);