X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/a249b3e6fd798935a02b769149c9791a6fa6ef16..89901946f936446f439b95f1a9a85ac942ac2c92:/apt-pkg/indexfile.cc diff --git a/apt-pkg/indexfile.cc b/apt-pkg/indexfile.cc index 657cdfb36..a777c38ac 100644 --- a/apt-pkg/indexfile.cc +++ b/apt-pkg/indexfile.cc @@ -310,7 +310,7 @@ std::string pkgDebianIndexRealFile::GetProgressDescription() const } bool pkgDebianIndexRealFile::OpenListFile(FileFd &Pkg, std::string const &FileName)/*{{{*/ { - if (Pkg.Open(FileName, FileFd::ReadOnly, FileFd::None) == false) + if (Pkg.Open(FileName, FileFd::ReadOnly, FileFd::Extension) == false) return _error->Error("Problem opening %s",FileName.c_str()); return true; } @@ -325,12 +325,18 @@ pkgDebianIndexFile::~pkgDebianIndexFile() pkgCacheListParser * pkgDebianIndexFile::CreateListParser(FileFd &Pkg) { if (Pkg.IsOpen() == false) - return NULL; + return nullptr; _error->PushToStack(); pkgCacheListParser * const Parser = new debListParser(&Pkg); bool const newError = _error->PendingError(); _error->MergeWithStack(); - return newError ? NULL : Parser; + if (newError) + { + delete Parser; + return nullptr; + } + else + return Parser; } bool pkgDebianIndexFile::Merge(pkgCacheGenerator &Gen,OpProgress * const Prog) {