Commit b1c17752 authored by Max Kellermann's avatar Max Kellermann

locate: use g_ascii_strcasecmp() instead of strcasecmp()

strcasecmp() is locale dependent, making it a bad choice for internal string comparisons.
parent 0edfbc8a
...@@ -35,15 +35,15 @@ locate_parse_type(const char *str) ...@@ -35,15 +35,15 @@ locate_parse_type(const char *str)
{ {
int i; int i;
if (0 == strcasecmp(str, LOCATE_TAG_FILE_KEY) || if (0 == g_ascii_strcasecmp(str, LOCATE_TAG_FILE_KEY) ||
0 == strcasecmp(str, LOCATE_TAG_FILE_KEY_OLD)) 0 == g_ascii_strcasecmp(str, LOCATE_TAG_FILE_KEY_OLD))
return LOCATE_TAG_FILE_TYPE; return LOCATE_TAG_FILE_TYPE;
if (0 == strcasecmp(str, LOCATE_TAG_ANY_KEY)) if (0 == g_ascii_strcasecmp(str, LOCATE_TAG_ANY_KEY))
return LOCATE_TAG_ANY_TYPE; return LOCATE_TAG_ANY_TYPE;
for (i = 0; i < TAG_NUM_OF_ITEM_TYPES; i++) for (i = 0; i < TAG_NUM_OF_ITEM_TYPES; i++)
if (0 == strcasecmp(str, tag_item_names[i])) if (0 == g_ascii_strcasecmp(str, tag_item_names[i]))
return i; return i;
return -1; return -1;
......
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