aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/playlist.c9
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);