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;
}
+2 -2
View File
@@ -254,7 +254,7 @@ function love.init()
-- If config file exists, load it and allow it to update config table.
if not love.conf and love.filesystem and love.filesystem.exists("conf.lua") then
require("conf.lua")
require("conf")
end
-- Yes, conf.lua might not exist, but there are other ways of making
@@ -303,7 +303,7 @@ function love.init()
if love.filesystem then
love.filesystem.setRelease(c.release and is_fused_game)
if c.identity then love.filesystem.setIdentity(c.identity) end
if love.filesystem.exists("main.lua") then require("main.lua") end
if love.filesystem.exists("main.lua") then require("main") end
end
if no_game_code then
+2 -3
View File
@@ -419,8 +419,7 @@ const unsigned char boot_lua[] =
0x6d, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73,
0x74, 0x65, 0x6d, 0x2e, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x28, 0x22, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x6c,
0x75, 0x61, 0x22, 0x29, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
0x09, 0x09, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x28, 0x22, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x6c, 0x75,
0x61, 0x22, 0x29, 0x0a,
0x09, 0x09, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x28, 0x22, 0x63, 0x6f, 0x6e, 0x66, 0x22, 0x29, 0x0a,
0x09, 0x65, 0x6e, 0x64, 0x0a,0x0a,
0x09, 0x2d, 0x2d, 0x20, 0x59, 0x65, 0x73, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x6c, 0x75, 0x61, 0x20,
0x6d, 0x69, 0x67, 0x68, 0x74, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x65, 0x78, 0x69, 0x73, 0x74, 0x2c, 0x20, 0x62,
@@ -513,7 +512,7 @@ const unsigned char boot_lua[] =
0x09, 0x09, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74,
0x65, 0x6d, 0x2e, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x28, 0x22, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x6c, 0x75,
0x61, 0x22, 0x29, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x28, 0x22,
0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x6c, 0x75, 0x61, 0x22, 0x29, 0x20, 0x65, 0x6e, 0x64, 0x0a,
0x6d, 0x61, 0x69, 0x6e, 0x22, 0x29, 0x20, 0x65, 0x6e, 0x64, 0x0a,
0x09, 0x65, 0x6e, 0x64, 0x0a,0x0a,
0x09, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x5f, 0x67, 0x61, 0x6d, 0x65, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x74,
0x68, 0x65, 0x6e, 0x0a,