Commit d3c93c1c authored by Max Kellermann's avatar Max Kellermann

tag: use g_ascii_strcasecmp() instead of strcasecmp()

strcasecmp() is locale dependent, making it a bad choice for internal string comparisons.
parent b2924405
...@@ -89,7 +89,7 @@ void tag_lib_init(void) ...@@ -89,7 +89,7 @@ void tag_lib_init(void)
memset(ignore_tag_items, true, TAG_NUM_OF_ITEM_TYPES); memset(ignore_tag_items, true, TAG_NUM_OF_ITEM_TYPES);
if (0 == strcasecmp(value, "none")) if (0 == g_ascii_strcasecmp(value, "none"))
return; return;
temp = c = s = g_strdup(value); temp = c = s = g_strdup(value);
...@@ -99,7 +99,7 @@ void tag_lib_init(void) ...@@ -99,7 +99,7 @@ void tag_lib_init(void)
quit = 1; quit = 1;
*s = '\0'; *s = '\0';
for (i = 0; i < TAG_NUM_OF_ITEM_TYPES; i++) { for (i = 0; i < TAG_NUM_OF_ITEM_TYPES; i++) {
if (strcasecmp(c, tag_item_names[i]) == 0) { if (g_ascii_strcasecmp(c, tag_item_names[i]) == 0) {
ignore_tag_items[i] = false; ignore_tag_items[i] = false;
break; break;
} }
......
...@@ -126,7 +126,7 @@ tag_ape_load(const char *file) ...@@ -126,7 +126,7 @@ tag_ape_load(const char *file)
/* we only care about utf-8 text tags */ /* we only care about utf-8 text tags */
if (!(flags & (0x3 << 1))) { if (!(flags & (0x3 << 1))) {
for (i = 0; i < 7; i++) { for (i = 0; i < 7; i++) {
if (strcasecmp(key, apeItems[i]) == 0) { if (g_ascii_strcasecmp(key, apeItems[i]) == 0) {
if (!ret) if (!ret)
ret = tag_new(); ret = tag_new();
tag_add_item_n(ret, tagItems[i], tag_add_item_n(ret, tagItems[i],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment