Fix comparison of family names to ignore leading space properly

Previously fc-match "xxx,nazli" matched Nazli, but "xxx, nazli" didn't.
This was because of a bug in FcCompareFamily's short-circuit check
that forgot to ignore spaces.
This commit is contained in:
Behdad Esfahbod 2008-12-31 18:06:07 -05:00
parent 0c93b91db0
commit a291cfc710
1 changed files with 2 additions and 1 deletions

View File

@ -72,7 +72,8 @@ FcCompareFamily (FcValue *v1, FcValue *v2)
const FcChar8* v1_string = fc_value_string(v1); const FcChar8* v1_string = fc_value_string(v1);
const FcChar8* v2_string = fc_value_string(v2); const FcChar8* v2_string = fc_value_string(v2);
if (FcToLower(*v1_string) != FcToLower(*v2_string)) if (FcToLower(*v1_string) != FcToLower(*v2_string) &&
*v1_string != ' ' && *v2_string != ' ')
return 1.0; return 1.0;
return (double) FcStrCmpIgnoreBlanksAndCase (v1_string, v2_string) != 0; return (double) FcStrCmpIgnoreBlanksAndCase (v1_string, v2_string) != 0;