find .luac first (#17572)

This commit is contained in:
minggo 2017-03-23 10:43:39 +08:00 committed by GitHub
parent 1b46096b15
commit cab5195ad4
1 changed files with 5 additions and 4 deletions

View File

@ -259,18 +259,19 @@ int LuaStack::executeScriptFile(const char* filename)
}
FileUtils *utils = FileUtils::getInstance();
//
// 1. check .lua suffix
// 2. check .luac suffix
// 1. check .luac suffix
// 2. check .lua suffix
//
std::string tmpfilename = buf + NOT_BYTECODE_FILE_EXT;
std::string tmpfilename = buf + BYTECODE_FILE_EXT;
if (utils->isFileExist(tmpfilename))
{
buf = tmpfilename;
}
else
{
tmpfilename = buf + BYTECODE_FILE_EXT;
tmpfilename = buf + NOT_BYTECODE_FILE_EXT;
if (utils->isFileExist(tmpfilename))
{
buf = tmpfilename;