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[idx++] = in;
/* ignore MS line endings */
if (in != '\r')
newline[idx++] = in;
in = filestream_getc(file);
}
newline[idx] = '\0';

View File

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