fix bug #307
git-svn-id: https://svn.musicpd.org/mpd/trunk@2230 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
parent
d05c3b510e
commit
c0e0c2460f
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user