aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-01-10 19:06:16 +0100
committerMattias Andrée <maandree@kth.se>2023-01-10 19:06:16 +0100
commit916d19e025049cd970b9298a4dca03a034e603e5 (patch)
tree99912ffaf3b0ab84f967ff5229aa9e8459cc5ec3
parentlibfonts_do_font_descriptions_match: attempt to decode first to handle unnormalized data (diff)
downloadlibfonts-916d19e025049cd970b9298a4dca03a034e603e5.tar.gz
libfonts-916d19e025049cd970b9298a4dca03a034e603e5.tar.bz2
libfonts-916d19e025049cd970b9298a4dca03a034e603e5.tar.xz
Ignore case (ASCII) when comparing font descriptions
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r--libfonts_do_decoded_font_descriptions_match.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libfonts_do_decoded_font_descriptions_match.c b/libfonts_do_decoded_font_descriptions_match.c
index 24d3268..091382e 100644
--- a/libfonts_do_decoded_font_descriptions_match.c
+++ b/libfonts_do_decoded_font_descriptions_match.c
@@ -35,7 +35,7 @@ equal(const char *desc, const char *spec)
return 0;
for (; desc[i] && spec[i]; i++)
- if (spec[i] != desc[i] && spec[i] != '?')
+ if (tolower(spec[i]) != tolower(desc[i]) && spec[i] != '?')
return 0;
return desc[i] == spec[i];
@@ -56,7 +56,7 @@ many_equal(const char *desc, const char *spec)
desc++;
} else {
while (*spec && *desc && *spec != '-' && *desc != '-') {
- if (*spec != *desc && *spec != '?')
+ if (tolower(*spec) != tolower(*desc) && *spec != '?')
return 0;
}
}