X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/188a6fcf4f13df1fd362a0aff27a23493ddd1ec5..7c4f1ca5fe315a8223570b05994d6d7ca7c55c4f:/apt-pkg/policy.cc diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index 8441bc465..bea4bec89 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -439,7 +439,7 @@ bool ReadPinFile(pkgPolicy &Plcy,string File) FileFd Fd(File,FileFd::ReadOnly); pkgTagFile TF(&Fd); - if (_error->PendingError() == true) + if (Fd.IsOpen() == false || Fd.Failed()) return false; pkgUserTagSection Tags; @@ -478,10 +478,13 @@ bool ReadPinFile(pkgPolicy &Plcy,string File) } for (; Word != End && isspace(*Word) != 0; Word++); - int priority = Tags.FindI("Pin-Priority", 0); + _error->PushToStack(); + int const priority = Tags.FindI("Pin-Priority", 0); + bool const newError = _error->PendingError(); + _error->MergeWithStack(); if (priority < std::numeric_limits::min() || priority > std::numeric_limits::max() || - _error->PendingError()) { + newError) { return _error->Error(_("%s: Value %s is outside the range of valid pin priorities (%d to %d)"), File.c_str(), Tags.FindS("Pin-Priority").c_str(), std::numeric_limits::min(),