# HG changeset patch # User Myhailo Danylenko # Date 1270403612 -10800 # Node ID bc3201298e52c53331aaaf9a9601d7dd278eaa08 # Parent 626ff4f835190f8a5776ff476ccfeab3f1624658 Allow nil in main.command to delete command diff -r 626ff4f83519 -r bc3201298e52 lua.c --- a/lua.c Sun Apr 04 16:44:27 2010 +0300 +++ b/lua.c Sun Apr 04 20:53:32 2010 +0300 @@ -995,7 +995,7 @@ const char *name = luaL_checkstring (L, 1); // XXX: to_utf8? looks like no :/ lua_command_callback_t *cb; int top = lua_gettop (L); - if (top > 1) { // Register + if (top > 1 && !(top == 2 && lua_isnil (L, 2))) { // Register guint cid = 0; int parse = 0; luaL_argcheck (L, lua_isfunction (L, 2), 2, "function expected");