]> git.lizzy.rs Git - minetest.git/commitdiff
override.txt: Fix crash due to CRLF endings (#8439)
authorDavid G <kestral246@gmail.com>
Sat, 25 May 2019 16:01:55 +0000 (18:01 +0200)
committerSmallJoker <mk939@ymail.com>
Sat, 25 May 2019 16:01:55 +0000 (18:01 +0200)
src/nodedef.cpp

index 83e3968c3d3c784a38fb40c534cbca4d9c5339e0..2ffdf2fc2a6ab7e163adac7a7e978fe9055fb159 100644 (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