override.txt: Fix crash due to CRLF endings (#8439)

master
David G 2019-05-25 18:01:55 +02:00 committed by SmallJoker
parent 627a96cd99
commit 40dadecb6e
1 changed files with 4 additions and 1 deletions

View File

@ -1300,8 +1300,11 @@ void NodeDefManager::applyTextureOverrides(const std::string &override_filepath)
int line_c = 0;
while (std::getline(infile, line)) {
line_c++;
if (trim(line).empty())
// Also trim '\r' on DOS-style files
line = trim(line);
if (line.empty())
continue;
std::vector<std::string> splitted = str_split(line, ' ');
if (splitted.size() != 3) {
errorstream << override_filepath