]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/policy.cc
if conf unset, don't read / as conf/pref/sources dir
[apt.git] / apt-pkg / policy.cc
index 2bdd96d8c85ec552e113f019116abebb811b5a81..ff59fb0ac6605385e786c93166534fdc46ce8993 100644 (file)
@@ -307,11 +307,11 @@ APT_PURE signed short pkgPolicy::GetPriority(pkgCache::PkgFileIterator const &Fi
 bool ReadPinDir(pkgPolicy &Plcy,string Dir)
 {
    if (Dir.empty() == true)
-      Dir = _config->FindDir("Dir::Etc::PreferencesParts");
+      Dir = _config->FindDir("Dir::Etc::PreferencesParts", "/dev/null");
 
    if (DirectoryExists(Dir) == false)
    {
-      if (Dir != "/dev/null")
+      if (APT::String::Endswith(Dir, "/dev/null") == false)
         _error->WarningE("DirectoryExists",_("Unable to read %s"),Dir.c_str());
       return true;
    }