'everything' module: small fix for fuzzy match

SVN revision: 41780
This commit is contained in:
Hannes Janetzek 2009-08-14 23:50:48 +00:00
parent 346dabf57c
commit 7ec03f3ce6
1 changed files with 5 additions and 1 deletions

View File

@ -462,10 +462,14 @@ evry_fuzzy_match(const char *str, const char *match)
unsigned int last = 0;
unsigned char first;
unsigned int min = 0;
unsigned int spaces = 1;
if (!match || !str) return 0;
for (m = match; *m != 0; m++)
if (isspace(*m)) spaces++;
for (m = match; *m != 0, spaces > 0; m++, spaces--)
{
mc = tolower(*m);
first = 0;
@ -475,7 +479,7 @@ evry_fuzzy_match(const char *str, const char *match)
pc = tolower(*p);
/* new word of string begins */
if ((cnt > 1) && (isspace(pc)) && (!isspace(mc)))
if ((cnt > 1) && (isspace(pc)) && (!pc != mc))
{
/* remember count */
if (!min)