equal
deleted
inserted
replaced
993 static int lua_main_command (lua_State *L) |
993 static int lua_main_command (lua_State *L) |
994 { |
994 { |
995 const char *name = luaL_checkstring (L, 1); // XXX: to_utf8? looks like no :/ |
995 const char *name = luaL_checkstring (L, 1); // XXX: to_utf8? looks like no :/ |
996 lua_command_callback_t *cb; |
996 lua_command_callback_t *cb; |
997 int top = lua_gettop (L); |
997 int top = lua_gettop (L); |
998 if (top > 1) { // Register |
998 if (top > 1 && !(top == 2 && lua_isnil (L, 2))) { // Register |
999 guint cid = 0; |
999 guint cid = 0; |
1000 int parse = 0; |
1000 int parse = 0; |
1001 luaL_argcheck (L, lua_isfunction (L, 2), 2, "function expected"); |
1001 luaL_argcheck (L, lua_isfunction (L, 2), 2, "function expected"); |
1002 |
1002 |
1003 if (top > 2) { // parse flag provided |
1003 if (top > 2) { // parse flag provided |