forked from enlightenment/enlightenment
'everything' module: small fix for fuzzy match
SVN revision: 41780
This commit is contained in:
parent
346dabf57c
commit
7ec03f3ce6
|
@ -462,10 +462,14 @@ evry_fuzzy_match(const char *str, const char *match)
|
||||||
unsigned int last = 0;
|
unsigned int last = 0;
|
||||||
unsigned char first;
|
unsigned char first;
|
||||||
unsigned int min = 0;
|
unsigned int min = 0;
|
||||||
|
unsigned int spaces = 1;
|
||||||
|
|
||||||
if (!match || !str) return 0;
|
if (!match || !str) return 0;
|
||||||
|
|
||||||
for (m = match; *m != 0; m++)
|
for (m = match; *m != 0; m++)
|
||||||
|
if (isspace(*m)) spaces++;
|
||||||
|
|
||||||
|
for (m = match; *m != 0, spaces > 0; m++, spaces--)
|
||||||
{
|
{
|
||||||
mc = tolower(*m);
|
mc = tolower(*m);
|
||||||
first = 0;
|
first = 0;
|
||||||
|
@ -475,7 +479,7 @@ evry_fuzzy_match(const char *str, const char *match)
|
||||||
pc = tolower(*p);
|
pc = tolower(*p);
|
||||||
|
|
||||||
/* new word of string begins */
|
/* new word of string begins */
|
||||||
if ((cnt > 1) && (isspace(pc)) && (!isspace(mc)))
|
if ((cnt > 1) && (isspace(pc)) && (!pc != mc))
|
||||||
{
|
{
|
||||||
/* remember count */
|
/* remember count */
|
||||||
if (!min)
|
if (!min)
|
||||||
|
|
Loading…
Reference in New Issue