aboutsummaryrefslogtreecommitdiffstats
path: root/src/song.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/song.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 '')
-rw-r--r--src/song.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/song.c b/src/song.c
index 9cbd859f5..b56c798cb 100644
--- a/src/song.c
+++ b/src/song.c
@@ -176,16 +176,14 @@ song_file_update_inarchive(struct song *song)
}
char *
-song_get_url(const struct song *song, char *path_max_tmp)
+song_get_uri(const struct song *song)
{
assert(song != NULL);
assert(*song->url);
if (!song_in_database(song) || directory_is_root(song->parent))
- strcpy(path_max_tmp, song->url);
+ return g_strdup(song->url);
else
- pfx_dir(path_max_tmp, song->url, strlen(song->url),
- directory_get_path(song->parent),
- strlen(directory_get_path(song->parent)));
- return path_max_tmp;
+ return g_strconcat(directory_get_path(song->parent),
+ "/", song->url, NULL);
}