diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/directory.c | 3 | ||||
-rw-r--r-- | src/inputPlugins/flac_plugin.c | 4 | ||||
-rw-r--r-- | src/inputPlugins/ogg_plugin.c | 4 | ||||
-rw-r--r-- | src/ls.c | 4 | ||||
-rw-r--r-- | src/song.c | 6 | ||||
-rw-r--r-- | src/tag.c | 1 |
6 files changed, 12 insertions, 10 deletions
diff --git a/src/directory.c b/src/directory.c index 0666692ae..79b3b1bb9 100644 --- a/src/directory.c +++ b/src/directory.c @@ -356,6 +356,7 @@ int removeDeletedFromDirectory(Directory * directory) { while((ent = readdir(dir))) { if(ent->d_name[0]=='.') continue; /* hide hidden stuff */ + if(strchr(ent->d_name, '\n')) continue; utf8 = fsCharsetToUtf8(ent->d_name); @@ -558,6 +559,7 @@ int updateDirectory(Directory * directory) { while((ent = readdir(dir))) { if(ent->d_name[0]=='.') continue; /* hide hidden stuff */ + if(strchr(ent->d_name, '\n')) continue; utf8 = fsCharsetToUtf8(ent->d_name); @@ -604,6 +606,7 @@ int exploreDirectory(Directory * directory) { DEBUG("explore: %s\n",dirname); while((ent = readdir(dir))) { if(ent->d_name[0]=='.') continue; /* hide hidden stuff */ + if(strchr(ent->d_name, '\n')) continue; utf8 = fsCharsetToUtf8(ent->d_name); diff --git a/src/inputPlugins/flac_plugin.c b/src/inputPlugins/flac_plugin.c index dc92b801b..8ae631a97 100644 --- a/src/inputPlugins/flac_plugin.c +++ b/src/inputPlugins/flac_plugin.c @@ -470,7 +470,6 @@ MpdTag * flacMetadataDup(char * file, int * vorbisCommentFound) { dup = malloc(len+1); memcpy(dup,&(block->data.vorbis_comment.comments[offset].entry[pos]),len); dup[len] = '\0'; - stripReturnChar(dup); ret->artist = dup; } } @@ -484,7 +483,6 @@ MpdTag * flacMetadataDup(char * file, int * vorbisCommentFound) { dup = malloc(len+1); memcpy(dup,&(block->data.vorbis_comment.comments[offset].entry[pos]),len); dup[len] = '\0'; - stripReturnChar(dup); ret->album = dup; } } @@ -498,7 +496,6 @@ MpdTag * flacMetadataDup(char * file, int * vorbisCommentFound) { dup = malloc(len+1); memcpy(dup,&(block->data.vorbis_comment.comments[offset].entry[pos]),len); dup[len] = '\0'; - stripReturnChar(dup); ret->title = dup; } } @@ -512,7 +509,6 @@ MpdTag * flacMetadataDup(char * file, int * vorbisCommentFound) { dup = malloc(len+1); memcpy(dup,&(block->data.vorbis_comment.comments[offset].entry[pos]),len); dup[len] = '\0'; - stripReturnChar(dup); ret->track = dup; } } diff --git a/src/inputPlugins/ogg_plugin.c b/src/inputPlugins/ogg_plugin.c index 8e42dec55..369939b33 100644 --- a/src/inputPlugins/ogg_plugin.c +++ b/src/inputPlugins/ogg_plugin.c @@ -174,28 +174,24 @@ MpdTag * oggCommentsParse(char ** comments) { if(!ret) ret = newMpdTag(); if(!ret->artist) { ret->artist = strdup(temp); - stripReturnChar(ret->artist); } } else if((temp = ogg_parseComment(*comments,"title"))) { if(!ret) ret = newMpdTag(); if(!ret->title) { ret->title = strdup(temp); - stripReturnChar(ret->title); } } else if((temp = ogg_parseComment(*comments,"album"))) { if(!ret) ret = newMpdTag(); if(!ret->album) { ret->album = strdup(temp); - stripReturnChar(ret->album); } } else if((temp = ogg_parseComment(*comments,"tracknumber"))) { if(!ret) ret = newMpdTag(); if(!ret->track) { ret->track = strdup(temp); - stripReturnChar(ret->track); } } @@ -172,7 +172,9 @@ int lsPlaylists(FILE * fp, char * utf8path) { node = list->firstNode; while(node!=NULL) { - myfprintf(fp,"playlist: %s%s\n",dup,node->key); + if(!strchr(node->key, '\n')) { + myfprintf(fp,"playlist: %s%s\n",dup,node->key); + } node = node->nextNode; } diff --git a/src/song.c b/src/song.c index c1f465177..ed88f1f60 100644 --- a/src/song.c +++ b/src/song.c @@ -51,7 +51,11 @@ Song * newNullSong() { } Song * newSong(char * utf8url, SONG_TYPE type) { - Song * song = newNullSong(); + Song * song = NULL; + + if(strchr(utf8url, '\n')) return NULL; + + song = newNullSong(); song->utf8url = strdup(utf8url); song->type = type; @@ -53,6 +53,7 @@ void printMpdTag(FILE * fp, MpdTag * tag) { temp = latin1StrToUtf8Dup(str); \ free(str); \ str = temp; \ + stripReturnChar(str); \ } \ } |