X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/4213f040ac8464d8826b64746c49c21c53a1ab12..be9b62f76406cf2546d21f3ca27587ee20e0fc37:/apt-pkg/versionmatch.cc?ds=sidebyside diff --git a/apt-pkg/versionmatch.cc b/apt-pkg/versionmatch.cc index a269338d6..c40b1fdbc 100644 --- a/apt-pkg/versionmatch.cc +++ b/apt-pkg/versionmatch.cc @@ -118,7 +118,10 @@ pkgVersionMatch::pkgVersionMatch(string Data,MatchType Type) : Type(Type) if (Type == Origin) { - OrSite = Data; + if (Data[0] == '"' && Data.length() >= 2 && Data.end()[-1] == '"') + OrSite = Data.substr(1, Data.length() - 2); + else + OrSite = Data; return; } } @@ -188,6 +191,7 @@ bool pkgVersionMatch::ExpressionMatches(const char *pattern, const char *string) res = true; } free(regex); + regfree(&preg); return res; } } @@ -258,10 +262,10 @@ bool pkgVersionMatch::FileMatch(pkgCache::PkgFileIterator File) if (Type == Origin) { if (OrSite.empty() == false) { - if (File->Site == 0 || !ExpressionMatches(OrSite, File.Site())) + if (File->Site == 0) return false; } else // so we are talking about file:// or status file - if (strcmp(File.Site(),"") == 0 && File->Archive != 0) // skip the status file + if (strcmp(File.Site(),"") == 0 && File->Archive != 0 && strcmp(File.Archive(),"now") == 0) // skip the status file return false; return (ExpressionMatches(OrSite, File.Site())); /* both strings match */ }