aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2005-03-08 01:07:46 +0000
committerWarren Dukes <warren.dukes@gmail.com>2005-03-08 01:07:46 +0000
commitfa08a7e3ff0d0f60415c29c080cc4130cf4032c9 (patch)
tree6b713b2a3b1c1759891dc03f4ccf3e9fabd35ffd /src
parent8db09d0b766638cef7262f96d79d07a7b82fdf3f (diff)
downloadmpd-fa08a7e3ff0d0f60415c29c080cc4130cf4032c9.tar.gz
mpd-fa08a7e3ff0d0f60415c29c080cc4130cf4032c9.tar.xz
mpd-fa08a7e3ff0d0f60415c29c080cc4130cf4032c9.zip
for windows compatibility, if we're unable to add a song, convert '\' to '/' and try again to add the file
git-svn-id: https://svn.musicpd.org/mpd/trunk@3036 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src')
-rw-r--r--src/playlist.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/playlist.c b/src/playlist.c
index 3a2bfcc78..580116260 100644
--- a/src/playlist.c
+++ b/src/playlist.c
@@ -1408,11 +1408,21 @@ int loadPlaylist(FILE * fp, char * utf8file) {
if(commentCharFound && !getSongFromDB(temp)
&& !isRemoteUrl(temp))
{
- free(temp);
- continue;
}
- if((addToPlaylist(stderr, temp, 0))<0) {
- if(!erroredFile) erroredFile = strdup(temp);
+ else if((addToPlaylist(stderr, temp, 0))<0) {
+ /* for windows compatibilit, convert slashes */
+ char * temp2 = strdup(temp);
+ char * p = temp2;
+ while(*p) {
+ if(*p=='\\') *p = '/';
+ p++;
+ }
+ if((addToPlaylist(stderr, temp2, 0))<0) {
+ if(!erroredFile) {
+ erroredFile = strdup(temp);
+ }
+ }
+ free(temp2);
}
free(temp);
}