]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Fix incorrect comparison with multiple values 90/head
authorClemens Lang <neverpanic@gmail.com>
Sat, 30 May 2015 19:56:22 +0000 (21:56 +0200)
committerClemens Lang <neverpanic@gmail.com>
Wed, 10 Jun 2015 23:35:21 +0000 (01:35 +0200)
  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 <neverpanic@gmail.com>
bindings/solv.i

index 3481579d086e582aabc98dabddb675d95614664e..1a44e2a23c0d4f9f3ade6c5855415772ad0e646f 100644 (file)
@@ -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);