Fix text mode dependency

This commit is contained in:
Alcaro 2017-12-10 21:00:24 +01:00
parent d6fd9f0cc1
commit e07ed18105
2 changed files with 7 additions and 5 deletions

View File

@ -107,7 +107,9 @@ static char *getaline(RFILE *file)
newline = newline_tmp; newline = newline_tmp;
} }
newline[idx++] = in; /* ignore MS line endings */
if (in != '\r')
newline[idx++] = in;
in = filestream_getc(file); in = filestream_getc(file);
} }
newline[idx] = '\0'; newline[idx] = '\0';

View File

@ -519,10 +519,10 @@ static bool playlist_read_file(
/* Read playlist entry and terminate string with NUL character /* Read playlist entry and terminate string with NUL character
* regardless of Windows or Unix line endings * regardless of Windows or Unix line endings
*/ */
if((last = strrchr(buf[i], '\r'))) if((last = strrchr(buf[i], '\r')))
*last = '\0'; *last = '\0';
else if((last = strrchr(buf[i], '\n'))) else if((last = strrchr(buf[i], '\n')))
*last = '\0'; *last = '\0';
} }
entry = &playlist->entries[playlist->size]; entry = &playlist->entries[playlist->size];