Remove \r line endings before checksumming lua files, to sidestep issues when Windows git autoconverted line endings
This commit is contained in:
parent
c9c4bc3731
commit
7b5d402454
1 changed files with 2 additions and 0 deletions
|
@ -218,6 +218,8 @@ int LuaLoadFile(const std::string &file, const std::string &strArg)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (file.rfind("stratagus.lua") != -1 && file.find("scripts/") != -1) {
|
if (file.rfind("stratagus.lua") != -1 && file.find("scripts/") != -1) {
|
||||||
|
// First, remove '\r' characters from the input. These are added, for example, by Windows Git, and should be ignored
|
||||||
|
content.erase(std::remove(content.begin(), content.end(), '\r'), content.end());
|
||||||
FileChecksums ^= fletcher32(content);
|
FileChecksums ^= fletcher32(content);
|
||||||
}
|
}
|
||||||
const int status = luaL_loadbuffer(Lua, content.c_str(), content.size(), file.c_str());
|
const int status = luaL_loadbuffer(Lua, content.c_str(), content.size(), file.c_str());
|
||||||
|
|
Loading…
Reference in a new issue