summaryrefslogtreecommitdiff
path: root/apt-pkg/indexfile.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/indexfile.cc')
-rw-r--r--apt-pkg/indexfile.cc27
1 files changed, 10 insertions, 17 deletions
diff --git a/apt-pkg/indexfile.cc b/apt-pkg/indexfile.cc
index 934943205..492f29c5a 100644
--- a/apt-pkg/indexfile.cc
+++ b/apt-pkg/indexfile.cc
@@ -8,31 +8,30 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
-#include<config.h>
+#include <config.h>
+#include <apt-pkg/aptconfiguration.h>
#include <apt-pkg/configuration.h>
-#include <apt-pkg/indexfile.h>
+#include <apt-pkg/deblistparser.h>
#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
-#include <apt-pkg/aptconfiguration.h>
+#include <apt-pkg/indexfile.h>
+#include <apt-pkg/macros.h>
#include <apt-pkg/pkgcache.h>
#include <apt-pkg/pkgcachegen.h>
-#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/progress.h>
#include <apt-pkg/srcrecords.h>
#include <apt-pkg/strutl.h>
-#include <apt-pkg/progress.h>
-#include <apt-pkg/deblistparser.h>
-#include <apt-pkg/macros.h>
#include <apt-pkg/debindexfile.h>
#include <sys/stat.h>
-#include <string>
-#include <vector>
#include <clocale>
#include <cstring>
#include <memory>
+#include <string>
+#include <vector>
/*}}}*/
// Global list of Item supported
@@ -338,16 +337,10 @@ pkgCacheListParser * pkgDebianIndexFile::CreateListParser(FileFd &Pkg)
if (Pkg.IsOpen() == false)
return nullptr;
_error->PushToStack();
- pkgCacheListParser * const Parser = new debListParser(&Pkg);
+ std::unique_ptr<pkgCacheListParser> Parser(new debListParser(&Pkg));
bool const newError = _error->PendingError();
_error->MergeWithStack();
- if (newError)
- {
- delete Parser;
- return nullptr;
- }
- else
- return Parser;
+ return newError ? nullptr : Parser.release();
}
bool pkgDebianIndexFile::Merge(pkgCacheGenerator &Gen,OpProgress * const Prog)
{