diff options
author | Michael Vogt <mvo@debian.org> | 2014-04-10 09:39:35 +0200 |
---|---|---|
committer | Michael Vogt <mvo@debian.org> | 2014-04-10 09:39:35 +0200 |
commit | a1a253e8be978998b66af62240a25864db2cc694 (patch) | |
tree | 485efb6b77d063b08045153478e704e804242b7e /apt-private | |
parent | 4c3722e3a74f183b331b0a782017ae442ca143fb (diff) | |
parent | 5ff678f7a22bb3206f5e46fcbdd00e56cb44b99e (diff) |
Merge branch 'debian/sid' into ubuntu/master
Diffstat (limited to 'apt-private')
-rw-r--r-- | apt-private/private-list.cc | 5 | ||||
-rw-r--r-- | apt-private/private-list.h | 2 | ||||
-rw-r--r-- | apt-private/private-search.cc | 8 |
3 files changed, 9 insertions, 6 deletions
diff --git a/apt-private/private-list.cc b/apt-private/private-list.cc index 7664ca134..b053cbcbe 100644 --- a/apt-private/private-list.cc +++ b/apt-private/private-list.cc @@ -99,14 +99,13 @@ static void ListAllVersions(pkgCacheFile &CacheFile, pkgRecords &records,/*{{{*/ /*}}}*/ // list - list package based on criteria /*{{{*/ // --------------------------------------------------------------------- -bool List(CommandLine &Cmd) +bool DoList(CommandLine &Cmd) { pkgCacheFile CacheFile; pkgCache *Cache = CacheFile.GetPkgCache(); - pkgRecords records(CacheFile); - if (unlikely(Cache == NULL)) return false; + pkgRecords records(CacheFile); const char **patterns; const char *all_pattern[] = { "*", NULL}; diff --git a/apt-private/private-list.h b/apt-private/private-list.h index 461f527cb..aa2677764 100644 --- a/apt-private/private-list.h +++ b/apt-private/private-list.h @@ -5,7 +5,7 @@ class CommandLine; -APT_PUBLIC bool List(CommandLine &Cmd); +APT_PUBLIC bool DoList(CommandLine &Cmd); #endif diff --git a/apt-private/private-search.cc b/apt-private/private-search.cc index 8106333b6..ecd5d7fad 100644 --- a/apt-private/private-search.cc +++ b/apt-private/private-search.cc @@ -68,8 +68,12 @@ bool FullTextSearch(CommandLine &CmdL) /*{{{*/ const char *pattern = patterns[i]; all_found &= ( strstr(V.ParentPkg().Name(), pattern) != NULL || - parser.ShortDesc().find(pattern) != std::string::npos || - parser.LongDesc().find(pattern) != std::string::npos); + strcasestr(parser.ShortDesc().c_str(), pattern) != NULL || + strcasestr(parser.LongDesc().c_str(), pattern) != NULL); + // search patterns are AND by default so we can skip looking further + // on the first mismatch + if(all_found == false) + break; } if (all_found) { |