diff options
author | Max Kellermann <max@duempel.org> | 2008-10-15 19:36:37 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-10-15 19:36:37 +0200 |
commit | 047043d2a8ee4482a845ed9860dbf4cd01540eef (patch) | |
tree | ec8542ca3ea28e255bd857f01b7b8672fb029da5 /src/dbUtils.c | |
parent | 7366191f0d0d5c50ee051a3b60fc31ad86bce721 (diff) | |
download | mpd-047043d2a8ee4482a845ed9860dbf4cd01540eef.tar.gz mpd-047043d2a8ee4482a845ed9860dbf4cd01540eef.tar.xz mpd-047043d2a8ee4482a845ed9860dbf4cd01540eef.zip |
locate: use g_utf8_casefold() instead of string_toupper()
string_toupper() and strDupToUpper() were not able to deal with
character sets other than US-ASCII. Use GLib's g_utf8_casefold()
for strings.
Diffstat (limited to '')
-rw-r--r-- | src/dbUtils.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/dbUtils.c b/src/dbUtils.c index ddd4a024f..8f063f254 100644 --- a/src/dbUtils.c +++ b/src/dbUtils.c @@ -30,6 +30,8 @@ #include "log.h" #include "storedPlaylist.h" +#include <glib.h> + typedef struct _ListCommandItem { int8_t tagType; int numConditionals; @@ -103,7 +105,7 @@ int searchForSongsIn(struct client *client, const char *name, for (i = 0; i < numItems; i++) { originalNeedles[i] = items[i].needle; - items[i].needle = strDupToUpper(originalNeedles[i]); + items[i].needle = g_utf8_casefold(originalNeedles[i], -1); } data.client = client; @@ -113,7 +115,7 @@ int searchForSongsIn(struct client *client, const char *name, ret = db_walk(name, searchInDirectory, NULL, &data); for (i = 0; i < numItems; i++) { - free(items[i].needle); + g_free(items[i].needle); items[i].needle = originalNeedles[i]; } |