X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/74b220028595342028e3309002e4ec359af328f9..bc5095b7d708c7e376f98be6edc2ad7cceca57ed:/apt-pkg/versionmatch.cc diff --git a/apt-pkg/versionmatch.cc b/apt-pkg/versionmatch.cc index f336b3c35..284098bdf 100644 --- a/apt-pkg/versionmatch.cc +++ b/apt-pkg/versionmatch.cc @@ -16,14 +16,21 @@ #include <apt-pkg/versionmatch.h> #include <apt-pkg/strutl.h> #include <apt-pkg/error.h> +#include <apt-pkg/pkgcache.h> +#include <apt-pkg/cacheiterators.h> +#include <stddef.h> +#include <stdlib.h> +#include <string.h> +#include <string> #include <stdio.h> #include <ctype.h> #include <fnmatch.h> -#include <sys/types.h> #include <regex.h> /*}}}*/ +using std::string; + // VersionMatch::pkgVersionMatch - Constructor /*{{{*/ // --------------------------------------------------------------------- /* Break up the data string according to the selected type */ @@ -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';