aboutsummaryrefslogtreecommitdiffstats
path: root/src/locate.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-24 15:56:34 +0100
committerMax Kellermann <max@duempel.org>2009-01-24 15:56:34 +0100
commite6cb939a82d8559c338ce4cc824c55f4d58499e1 (patch)
treee5f794457752a791bfea3eb7aac301d9eba179d6 /src/locate.c
parent6a2118d04c7b73450edfffb6fdc40de1a05bfe94 (diff)
downloadmpd-e6cb939a82d8559c338ce4cc824c55f4d58499e1.tar.gz
mpd-e6cb939a82d8559c338ce4cc824c55f4d58499e1.tar.xz
mpd-e6cb939a82d8559c338ce4cc824c55f4d58499e1.zip
locate: added locate_item_list_casefold()
Merged casefolding code from two locations into this one library function.
Diffstat (limited to '')
-rw-r--r--src/locate.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/locate.c b/src/locate.c
index 9f6eff686..d334e797a 100644
--- a/src/locate.c
+++ b/src/locate.c
@@ -117,6 +117,18 @@ locate_item_list_parse(char *argv[], int argc)
return list;
}
+struct locate_item_list *
+locate_item_list_casefold(const struct locate_item_list *list)
+{
+ struct locate_item_list *new_list = locate_item_list_new(list->length);
+
+ for (unsigned i = 0; i < list->length; i++)
+ new_list->items[i].needle =
+ g_utf8_casefold(list->items[i].needle, -1);
+
+ return new_list;
+}
+
void
locate_item_free(struct locate_item *item)
{