]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/algorithms.cc
* add --dsc-only option, thanks to K. Richard Pixley
[apt.git] / apt-pkg / algorithms.cc
index e1b9406e2341f9d85d98793b055ecf055ab6363d..c6583f3b59e324277faf909e324fd2715481e266 100644 (file)
@@ -24,6 +24,8 @@
     
 #include <apti18n.h>
     
+#include <cstdlib>
+#include <algorithm>
 #include <iostream>
                                                                        /*}}}*/
 using namespace std;
@@ -497,7 +499,7 @@ void pkgProblemResolver::MakeScores()
          on the same level. We enhance the score of installed packages 
         if those are not obsolete
       */
-      if (I->CurrentVer != 0 && Cache[I].CandidateVerIter(Cache).Downloadable())
+      if (I->CurrentVer != 0 && Cache[I].CandidateVer != 0 && Cache[I].CandidateVerIter(Cache).Downloadable())
         Score += 1;
    }