summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/init.h2
-rw-r--r--apt-pkg/makefile2
-rw-r--r--apt-pkg/pkgrecords.cc16
-rw-r--r--apt-pkg/pkgrecords.h5
4 files changed, 14 insertions, 11 deletions
diff --git a/apt-pkg/init.h b/apt-pkg/init.h
index 0e91f164d..905173a7a 100644
--- a/apt-pkg/init.h
+++ b/apt-pkg/init.h
@@ -18,7 +18,7 @@
// See the makefile
#define APT_PKG_MAJOR 3
-#define APT_PKG_MINOR 52
+#define APT_PKG_MINOR 53
#define APT_PKG_RELEASE 0
extern const char *pkgVersion;
diff --git a/apt-pkg/makefile b/apt-pkg/makefile
index 10b012774..d36747d85 100644
--- a/apt-pkg/makefile
+++ b/apt-pkg/makefile
@@ -13,7 +13,7 @@ include ../buildlib/defaults.mak
# methods/makefile - FIXME
LIBRARY=apt-pkg
LIBEXT=$(GLIBC_VER)$(LIBSTDCPP_VER)
-MAJOR=3.52
+MAJOR=3.53
MINOR=0
SLIBS=$(PTHREADLIB) $(INTLLIBS)
APT_DOMAIN:=libapt-pkg$(MAJOR)
diff --git a/apt-pkg/pkgrecords.cc b/apt-pkg/pkgrecords.cc
index b22f3e73f..456b5aef4 100644
--- a/apt-pkg/pkgrecords.cc
+++ b/apt-pkg/pkgrecords.cc
@@ -23,11 +23,9 @@
// Records::pkgRecords - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* This will create the necessary structures to access the status files */
-pkgRecords::pkgRecords(pkgCache &Cache) : Cache(Cache), Files(0)
+pkgRecords::pkgRecords(pkgCache &Cache) : Cache(Cache),
+ Files(Cache.HeaderP->PackageFileCount)
{
- Files = new Parser *[Cache.HeaderP->PackageFileCount];
- memset(Files,0,sizeof(*Files)*Cache.HeaderP->PackageFileCount);
-
for (pkgCache::PkgFileIterator I = Cache.FileBegin();
I.end() == false; I++)
{
@@ -49,9 +47,13 @@ pkgRecords::pkgRecords(pkgCache &Cache) : Cache(Cache), Files(0)
/* */
pkgRecords::~pkgRecords()
{
- for (unsigned I = 0; I != Cache.HeaderP->PackageFileCount; I++)
- delete Files[I];
- delete [] Files;
+ for ( vector<Parser*>::iterator it = Files.begin();
+ it != Files.end();
+ ++it)
+ {
+ delete *it;
+ }
+
}
/*}}}*/
// Records::Lookup - Get a parser for the package version file /*{{{*/
diff --git a/apt-pkg/pkgrecords.h b/apt-pkg/pkgrecords.h
index 31c444dbf..ad3946c1b 100644
--- a/apt-pkg/pkgrecords.h
+++ b/apt-pkg/pkgrecords.h
@@ -23,6 +23,7 @@
#include <apt-pkg/pkgcache.h>
#include <apt-pkg/fileutl.h>
+#include <vector>
class pkgRecords
{
@@ -32,8 +33,8 @@ class pkgRecords
private:
pkgCache &Cache;
- Parser **Files;
-
+ std::vector<Parser *>Files;
+
public:
// Lookup function