X-Git-Url: http://git.hcoop.net/ntk/apt.git/blobdiff_plain/51b2a0fc603c8e4fe667bf7a278bd1ce151e38a3..1038d077588956448a423ed1c3887524a90d6532:/apt-pkg/srcrecords.cc diff --git a/apt-pkg/srcrecords.cc b/apt-pkg/srcrecords.cc index d63d2c42..775cf2e5 100644 --- a/apt-pkg/srcrecords.cc +++ b/apt-pkg/srcrecords.cc @@ -16,8 +16,13 @@ #include #include #include -#include #include +#include +#include + +#include +#include +#include #include /*}}}*/ @@ -42,7 +47,7 @@ pkgSrcRecords::pkgSrcRecords(pkgSourceList &List) : d(NULL), Files(0), Current(0 } // Doesn't work without any source index files - if (Files.size() == 0) + if (Files.empty() == true) { _error->Error(_("You must put some 'source' URIs" " in your sources.list")); @@ -70,8 +75,9 @@ bool pkgSrcRecords::Restart() Current = Files.begin(); for (std::vector::iterator I = Files.begin(); I != Files.end(); ++I) - (*I)->Restart(); - + if ((*I)->Offset() != 0) + (*I)->Restart(); + return true; } /*}}}*/ @@ -121,14 +127,13 @@ pkgSrcRecords::Parser *pkgSrcRecords::Find(const char *Package,bool const &SrcOn /* */ const char *pkgSrcRecords::Parser::BuildDepType(unsigned char const &Type) { - const char *fields[] = {"Build-Depends", - "Build-Depends-Indep", + const char *fields[] = {"Build-Depends", + "Build-Depends-Indep", "Build-Conflicts", "Build-Conflicts-Indep"}; - if (Type < 4) - return fields[Type]; - else + if (unlikely(Type >= sizeof(fields)/sizeof(fields[0]))) return ""; + return fields[Type]; } /*}}}*/