Drop old require syntax (no more .lua extension)

This commit is contained in:
Bart van Strien
2011-06-22 14:54:29 +02:00
parent d34d907b00
commit 160c17c180
3 changed files with 6 additions and 12 deletions
@@ -244,15 +244,10 @@ namespace physfs
const char * filename = lua_tostring(L, -1);
std::string tmp(filename);
tmp += ".lua";
int size = tmp.size();
if(size <= 4 || strcmp(filename + (size-4), ".lua") != 0)
{
tmp.append(".lua");
size = tmp.size();
}
for(int i=0;i<size-4;i++)
{
if(tmp[i] == '.')
@@ -291,7 +286,7 @@ namespace physfs
}
}
lua_pushfstring(L, "\n\tno file \"%s\" in LOVE game directories.\n", tmp.c_str());
lua_pushfstring(L, "\n\tno file \"%s\" in LOVE game directories.\n", (tmp + ".lua").c_str());
return 1;
}