summaryrefslogtreecommitdiff
path: root/apt-pkg/policy.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/policy.cc')
-rw-r--r--apt-pkg/policy.cc9
1 files changed, 6 insertions, 3 deletions
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<short>::min() ||
priority > std::numeric_limits<short>::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<short>::min(),