summaryrefslogtreecommitdiff
path: root/apt-pkg/policy.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2011-02-08 10:27:51 +0100
committerMichael Vogt <mvo@debian.org>2011-02-08 10:27:51 +0100
commit09b8bd3226a68272f98e4020d10348ff26642500 (patch)
tree1394a74a187ce61982c6c8649721de2f543459a1 /apt-pkg/policy.cc
parent7c748f4aa1bd47089672353fd1a401d1c5c94723 (diff)
parent4c6cf49317769725fee34a132c52ec1fe076b8b5 (diff)
merged from lp:~mvo/apt/mvo (which is really lp:~donkult/apt/sid with some updated comments ;)
Diffstat (limited to 'apt-pkg/policy.cc')
-rw-r--r--apt-pkg/policy.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc
index 4f9d56775..5427271b6 100644
--- a/apt-pkg/policy.cc
+++ b/apt-pkg/policy.cc
@@ -45,6 +45,8 @@ using namespace std;
file matches the V0 policy engine. */
pkgPolicy::pkgPolicy(pkgCache *Owner) : Pins(0), PFPriority(0), Cache(Owner)
{
+ if (Owner == 0 || &(Owner->Head()) == 0)
+ return;
PFPriority = new signed short[Owner->Head().PackageFileCount];
Pins = new Pin[Owner->Head().PackageCount];
@@ -328,7 +330,7 @@ bool ReadPinFile(pkgPolicy &Plcy,string File)
if (File.empty() == true)
File = _config->FindFile("Dir::Etc::Preferences");
- if (FileExists(File) == false)
+ if (RealFileExists(File) == false)
return true;
FileFd Fd(File,FileFd::ReadOnly);