X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/ea54214002c09eeb4dd498d97a564471ec9993c5..ecb777ddb4d13bb7a18bbf2ebb8e2c810dcaeb72:/apt-pkg/versionmatch.cc?ds=sidebyside diff --git a/apt-pkg/versionmatch.cc b/apt-pkg/versionmatch.cc index c23b4c3bf..284098bdf 100644 --- a/apt-pkg/versionmatch.cc +++ b/apt-pkg/versionmatch.cc @@ -16,14 +16,21 @@ #include #include #include +#include +#include +#include +#include +#include +#include #include #include #include -#include #include /*}}}*/ +using std::string; + // VersionMatch::pkgVersionMatch - Constructor /*{{{*/ // --------------------------------------------------------------------- /* Break up the data string according to the selected type */ @@ -60,7 +67,7 @@ pkgVersionMatch::pkgVersionMatch(string Data,MatchType Type) : Type(Type) // Are we a simple specification? string::const_iterator I = Data.begin(); - for (; I != Data.end() && *I != '='; I++); + for (; I != Data.end() && *I != '='; ++I); if (I == Data.end()) { // Temporary @@ -152,7 +159,7 @@ bool pkgVersionMatch::MatchVer(const char *A,string B,bool Prefix) pkgCache::VerIterator pkgVersionMatch::Find(pkgCache::PkgIterator Pkg) { pkgCache::VerIterator Ver = Pkg.VersionList(); - for (; Ver.end() == false; Ver++) + for (; Ver.end() == false; ++Ver) { if (Type == Version) { @@ -163,7 +170,7 @@ pkgCache::VerIterator pkgVersionMatch::Find(pkgCache::PkgIterator Pkg) continue; } - for (pkgCache::VerFileIterator VF = Ver.FileList(); VF.end() == false; VF++) + for (pkgCache::VerFileIterator VF = Ver.FileList(); VF.end() == false; ++VF) if (FileMatch(VF.File()) == true) return Ver; } @@ -179,9 +186,9 @@ pkgCache::VerIterator pkgVersionMatch::Find(pkgCache::PkgIterator Pkg) bool pkgVersionMatch::ExpressionMatches(const char *pattern, const char *string) { if (pattern[0] == '/') { - bool res = false; size_t length = strlen(pattern); if (pattern[length - 1] == '/') { + bool res = false; regex_t preg; char *regex = strdup(pattern + 1); regex[length - 2] = '\0';