elua: do not include the : in arg[0]

This commit is contained in:
Daniel Kolesa 2014-05-13 13:17:15 +01:00 committed by Daniel Kolesa
parent ab05d47d7c
commit 01a4fd89d2
1 changed files with 5 additions and 1 deletions

View File

@ -73,7 +73,11 @@ static int getargs(lua_State *L, int argc, char **argv, int n) {
for (i = n + 1; i < argc; ++i) lua_pushstring(L, argv[i]);
lua_createtable(L, narg, n + 1);
for (i = 0; i < argc; ++i) {
lua_pushstring(L, argv[i]);
if (!(i - n) && argv[i][0] == ':') {
lua_pushstring(L, &argv[i][1]);
} else {
lua_pushstring(L, argv[i]);
}
lua_rawseti(L, -2, i - n);
}
return narg;