Commit fa08a7e3 authored by Warren Dukes's avatar Warren Dukes

for windows compatibility, if we're unable to add a song, convert '\' to '/' and…

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
parent 8db09d0b
...@@ -1408,11 +1408,21 @@ int loadPlaylist(FILE * fp, char * utf8file) { ...@@ -1408,11 +1408,21 @@ int loadPlaylist(FILE * fp, char * utf8file) {
if(commentCharFound && !getSongFromDB(temp) if(commentCharFound && !getSongFromDB(temp)
&& !isRemoteUrl(temp)) && !isRemoteUrl(temp))
{ {
free(temp);
continue;
} }
if((addToPlaylist(stderr, temp, 0))<0) { else if((addToPlaylist(stderr, temp, 0))<0) {
if(!erroredFile) erroredFile = strdup(temp); /* 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); free(temp);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment