From a291cfc710c5989ba3e787ae20911d3176bea307 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 31 Dec 2008 18:06:07 -0500 Subject: [PATCH] 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. --- src/fcmatch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fcmatch.c b/src/fcmatch.c index a181496..e46eefe 100644 --- a/src/fcmatch.c +++ b/src/fcmatch.c @@ -72,7 +72,8 @@ FcCompareFamily (FcValue *v1, FcValue *v2) const FcChar8* v1_string = fc_value_string(v1); 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 (double) FcStrCmpIgnoreBlanksAndCase (v1_string, v2_string) != 0; -- 2.39.5