aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-14 20:52:49 +0200
committerMax Kellermann <max@duempel.org>2013-10-14 20:52:49 +0200
commit3be63549c07c52536689f61edf502d1773549616 (patch)
tree5417e0fffb71b315553e0ff6c352103a63fe9edc
parent9a1076256deef8bf806942eb72eabdbfdf74ddb3 (diff)
downloadmpd-3be63549c07c52536689f61edf502d1773549616.tar.gz
mpd-3be63549c07c52536689f61edf502d1773549616.tar.xz
mpd-3be63549c07c52536689f61edf502d1773549616.zip
stored_playlist: add "file://" prefix to absolute paths
Prepare to fix loading arbitrary song files from stored playlists.
-rw-r--r--src/stored_playlist.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/stored_playlist.c b/src/stored_playlist.c
index 39ba2bac1..e84d5e060 100644
--- a/src/stored_playlist.c
+++ b/src/stored_playlist.c
@@ -272,7 +272,14 @@ spl_load(const char *utf8path, GError **error_r)
if (*s == 0 || *s == PLAYLIST_COMMENT)
continue;
- if (!uri_has_scheme(s)) {
+ if (g_path_is_absolute(s)) {
+ char *t = fs_charset_to_utf8(s);
+ if (t == NULL)
+ continue;
+
+ s = g_strconcat("file://", t, NULL);
+ g_free(t);
+ } else if (!uri_has_scheme(s)) {
char *path_utf8;
path_utf8 = map_fs_to_utf8(s);