From: Jay Freeman (saurik) Date: Mon, 22 Feb 2010 17:48:05 +0000 (+0000) Subject: I am sick of that Package: error. X-Git-Url: https://git.saurik.com/apt-legacy.git/commitdiff_plain/d1238c914321ad94e5b1d30c1bdfdfcbe44e86d6?ds=inline I am sick of that Package: error. A tolerance.diff git-svn-id: http://svn.telesphoreo.org/trunk@699 514c082c-b64e-11dc-b46d-3d985efe055d --- diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 5b0da50..afc9163 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -643,11 +643,18 @@ bool debListParser::Step() iOffset = Tags.Offset(); while (Tags.Step(Section) == true) { + const char *Start; + const char *Stop; + + if (Section.Find("Package",Start,Stop) == false) { + _error->Warning("Encountered a section with no Package: header"); + continue; + } + /* See if this is the correct Architecture, if it isn't then we drop the whole section. A missing arch tag only happens (in theory) inside the Status file, so that is a positive return */ - const char *Start; - const char *Stop; + if (Section.Find("Architecture",Start,Stop) == false) return true;