aboutsummaryrefslogtreecommitdiffstats
path: root/src/mapper.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-30 13:47:52 +0100
committerMax Kellermann <max@duempel.org>2009-01-30 13:51:18 +0100
commitc38dd9e8d84eb7e398627bf6f2f562b2b0c35012 (patch)
tree3fb160e6da2f5113661faa2e5d6bd7b9b92afc7f /src/mapper.c
parente3d4fa6946140d91c02a8ae53e56ab8d056f172c (diff)
downloadmpd-c38dd9e8d84eb7e398627bf6f2f562b2b0c35012.tar.gz
mpd-c38dd9e8d84eb7e398627bf6f2f562b2b0c35012.tar.xz
mpd-c38dd9e8d84eb7e398627bf6f2f562b2b0c35012.zip
mapper: ignore duplicate slashes in playlists
When there are duplicate slashes in the song paths, eliminate them; example: /var/lib/mpd/music//foo.mp3 becomes: /var/lib/mpd/music/foo.mp3 The slash is only detected at the border between the music_directory and the local part.
Diffstat (limited to 'src/mapper.c')
-rw-r--r--src/mapper.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mapper.c b/src/mapper.c
index 1eecbf283..b167479dd 100644
--- a/src/mapper.c
+++ b/src/mapper.c
@@ -205,6 +205,9 @@ map_fs_to_utf8(const char *path_fs)
/* not within musicDir */
return NULL;
+ while (path_fs[0] == G_DIR_SEPARATOR)
+ ++path_fs;
+
return fs_charset_to_utf8(path_fs);
}