aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-10 12:51:15 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-10 12:51:15 +0100
commitab3266d743c8c84c09ead2ff79e73b21b822bc07 (patch)
tree33e9c04a6bf3d9bfdc11107faefad9c9d0d89579
parent19930e089cf5b7bf089855bed80471afe1064ee0 (diff)
downloadpaludis-ab3266d743c8c84c09ead2ff79e73b21b822bc07.tar.gz
paludis-ab3266d743c8c84c09ead2ff79e73b21b822bc07.tar.xz
Fuzzy finding now matches on substring too
-rw-r--r--paludis/fuzzy_finder.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/paludis/fuzzy_finder.cc b/paludis/fuzzy_finder.cc
index 5ed6ce3..1e7480b 100644
--- a/paludis/fuzzy_finder.cc
+++ b/paludis/fuzzy_finder.cc
@@ -97,8 +97,9 @@ namespace
for (QualifiedPackageNameSet::ConstIterator p(pkgs->begin()),
p_end(pkgs->end()); p_end != p; ++p)
- if (tolower(p->package().value()[0]) == _first_char &&
- _distance_calculator.distance_with(tolower_0_cost(p->package().value())) <= _threshold)
+ if (std::string::npos != stringify(p->package()).find(_package) || (
+ tolower(p->package().value()[0]) == _first_char &&
+ _distance_calculator.distance_with(tolower_0_cost(p->package().value())) <= _threshold))
result->insert(*p);
return result;