From: David G Date: Sat, 25 May 2019 16:01:55 +0000 (+0200) Subject: override.txt: Fix crash due to CRLF endings (#8439) X-Git-Tag: 5.1.0~209 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=40dadecb6ece6c9bbf7739e3a44ace25c0716dec;p=oweals%2Fminetest.git override.txt: Fix crash due to CRLF endings (#8439) --- diff --git a/src/nodedef.cpp b/src/nodedef.cpp index 83e3968c3..2ffdf2fc2 100644 --- a/src/nodedef.cpp +++ b/src/nodedef.cpp @@ -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 splitted = str_split(line, ' '); if (splitted.size() != 3) { errorstream << override_filepath