lyrics: fix loading of files with DOS line endings
This commit is contained in:
1
NEWS
1
NEWS
@@ -3,6 +3,7 @@ ncmpcpp-0.8 (????-??-??)
|
||||
* Support for controlling whether ncmpcpp should display multiple tags as-is or make an effort to hide duplicate values (show_duplicate_tags configuration variable, enabled by default).
|
||||
* Support for filtering of lists was brought back from the dead.
|
||||
* Require C++14 compatible compiler during compilation.
|
||||
* Lyrics from files containing DOS line endings now load properly on Linux.
|
||||
|
||||
ncmpcpp-0.7.7 (2016-10-31)
|
||||
* Fixed compilation on 32bit platforms.
|
||||
|
||||
@@ -316,6 +316,8 @@ void Lyrics::Load()
|
||||
std::string line;
|
||||
while (std::getline(input, line))
|
||||
{
|
||||
// Remove carriage returns as they mess up the display.
|
||||
line.erase(std::remove(line.begin(), line.end(), '\r'), line.end());
|
||||
if (!first)
|
||||
w << '\n';
|
||||
w << Charset::utf8ToLocale(line);
|
||||
|
||||
Reference in New Issue
Block a user