improve handling of line endings in m3u and cue files

This commit is contained in:
Jamiras 2019-09-21 08:04:57 -06:00
parent 302e2fdc53
commit c5750da85a
2 changed files with 3 additions and 4 deletions

View File

@ -1583,8 +1583,9 @@ found:
char disc_path[PATH_MAX_LENGTH];
char* tmp;
intfstream_read(m3u_stream, buffer, sizeof(buffer));
num_read = intfstream_read(m3u_stream, buffer, sizeof(buffer));
intfstream_close(m3u_stream);
buffer[num_read] = '\0';
tmp = buffer;
while (*tmp && *tmp != '\n')
@ -1640,7 +1641,7 @@ found:
if (exe_name)
{
scan = exe_name;
while (*scan != '\n' && *scan != ';' && *scan != ' ')
while (*scan != '\n' && *scan != '\r' && *scan != ';' && *scan != ' ')
++scan;
*scan = '\0';

View File

@ -344,8 +344,6 @@ static intfstream_t* cdfs_open_cue_track(const char* path, unsigned int track_in
while (*cue && *cue != '\n')
++cue;
if (cue == line)
continue;
if (*cue)
*cue++ = '\0';