Skip to content

Commit

Permalink
override.txt: Fix crash due to CRLF endings (#8439)
Browse files Browse the repository at this point in the history
  • Loading branch information
kestral246 authored and SmallJoker committed May 25, 2019
1 parent 627a96c commit 40dadec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/nodedef.cpp
Expand Up @@ -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
Expand Down

0 comments on commit 40dadec

Please sign in to comment.