diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-10-15 18:27:29 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-10-15 18:27:29 +0000 |
commit | c0e0c2460f19f750d7fb74f1f74d395c5a5c222c (patch) | |
tree | c64c5c64f773fc1f5f1b8011db5b0752af2baee4 /src/playlist.c | |
parent | d05c3b510e0e9c197c57895eaa4e80030c26a95e (diff) | |
download | mpd-c0e0c2460f19f750d7fb74f1f74d395c5a5c222c.tar.gz mpd-c0e0c2460f19f750d7fb74f1f74d395c5a5c222c.tar.xz mpd-c0e0c2460f19f750d7fb74f1f74d395c5a5c222c.zip |
fix bug #307
git-svn-id: https://svn.musicpd.org/mpd/trunk@2230 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/playlist.c')
-rw-r--r-- | src/playlist.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/playlist.c b/src/playlist.c index 1eba3b7be..c7e5057db 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -1318,7 +1318,7 @@ int savePlaylist(FILE * fp, char * utf8file) { int loadPlaylist(FILE * fp, char * utf8file) { FILE * fileP; - char s[MAXPATHLEN*1]; + char s[MAXPATHLEN+1]; int slength = 0; char * temp = strdup(utf8ToFsCharset(utf8file)); char * rfile = malloc(strlen(temp)+strlen(".")+ @@ -1328,6 +1328,7 @@ int loadPlaylist(FILE * fp, char * utf8file) { int parentlen = strlen(parent); char * erroredFile = NULL; int tempInt; + int commentCharFound = 0; strcpy(rfile,temp); strcat(rfile,"."); @@ -1353,7 +1354,11 @@ int loadPlaylist(FILE * fp, char * utf8file) { while((tempInt = fgetc(fileP))!=EOF) { s[slength] = tempInt; if(s[slength]=='\n' || s[slength]=='\0') { + commentCharFound = 0; s[slength] = '\0'; + if(s[0]==PLAYLIST_COMMENT) { + commentCharFound = 1; + } if(strncmp(s,musicDir,strlen(musicDir))==0) { strcpy(s,&(s[strlen(musicDir)])); } @@ -1379,7 +1384,7 @@ int loadPlaylist(FILE * fp, char * utf8file) { temp = fsCharsetToUtf8(s); if(!temp) continue; temp = strdup(temp); - if(s[0]==PLAYLIST_COMMENT && !getSongFromDB(temp) + if(commentCharFound && !getSongFromDB(temp) && !isRemoteUrl(temp)) { free(temp); |