aboutsummaryrefslogtreecommitdiffstats
path: root/src/locate.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-04 19:09:34 +0100
committerMax Kellermann <max@duempel.org>2009-01-04 19:09:34 +0100
commitfed719197c7014151710c4aae9174990fd131d59 (patch)
tree0fb6d6f69aa60ecdf9eb89286f8354316fffcc92 /src/locate.c
parentea8ae68e6f1a686fd96530fdaf7b428e33f58ec4 (diff)
downloadmpd-fed719197c7014151710c4aae9174990fd131d59.tar.gz
mpd-fed719197c7014151710c4aae9174990fd131d59.tar.xz
mpd-fed719197c7014151710c4aae9174990fd131d59.zip
song: allocate the result of song_get_url()
Diffstat (limited to 'src/locate.c')
-rw-r--r--src/locate.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/locate.c b/src/locate.c
index fb57c2cd0..55163b1e4 100644
--- a/src/locate.c
+++ b/src/locate.c
@@ -135,10 +135,12 @@ strstrSearchTag(struct song *song, enum tag_type type, char *str)
int8_t visitedTypes[TAG_NUM_OF_ITEM_TYPES] = { 0 };
if (type == LOCATE_TAG_FILE_TYPE || type == LOCATE_TAG_ANY_TYPE) {
- char path_max_tmp[MPD_PATH_MAX], *p;
+ char *uri, *p;
+
+ uri = song_get_uri(song);
+ p = g_utf8_casefold(uri, -1);
+ g_free(uri);
- song_get_url(song, path_max_tmp);
- p = g_utf8_casefold(path_max_tmp, -1);
if (strstr(p, str))
ret = 1;
g_free(p);
@@ -196,9 +198,13 @@ tagItemFoundAndMatches(struct song *song, enum tag_type type, char *str)
int8_t visitedTypes[TAG_NUM_OF_ITEM_TYPES] = { 0 };
if (type == LOCATE_TAG_FILE_TYPE || type == LOCATE_TAG_ANY_TYPE) {
- char path_max_tmp[MPD_PATH_MAX];
- if (0 == strcmp(str, song_get_url(song, path_max_tmp)))
+ char *uri = song_get_uri(song);
+ bool matches = strcmp(str, uri);
+ g_free(uri);
+
+ if (matches)
return 1;
+
if (type == LOCATE_TAG_FILE_TYPE)
return 0;
}