summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Bouthenot <kolter@openics.org>2006-02-09 10:33:48 +0000
committerEmmanuel Bouthenot <kolter@openics.org>2006-02-09 10:33:48 +0000
commitd4e755a641578cd823c5739ea63d0ea199b43bf7 (patch)
tree0890d09f660d76c58aa66bff74665a3d63433819
parent4a4daf6931674ca976e74a5d657934e53e282933 (diff)
downloadweechat-d4e755a641578cd823c5739ea63d0ea199b43bf7.zip
fix weechat_lua_add_message_handler : now really use function args
-rw-r--r--src/plugins/scripts/lua/weechat-lua.c9
-rw-r--r--weechat/src/plugins/scripts/lua/weechat-lua.c9
2 files changed, 12 insertions, 6 deletions
diff --git a/src/plugins/scripts/lua/weechat-lua.c b/src/plugins/scripts/lua/weechat-lua.c
index 198b6bbd5..1b4d41688 100644
--- a/src/plugins/scripts/lua/weechat-lua.c
+++ b/src/plugins/scripts/lua/weechat-lua.c
@@ -341,7 +341,7 @@ weechat_lua_add_message_handler (lua_State *L)
/* make gcc happy */
(void) L;
- char *irc_command, *function;
+ const char *irc_command, *function;
if (!lua_current_script)
{
@@ -366,8 +366,11 @@ weechat_lua_add_message_handler (lua_State *L)
return 1;
}
- if (!lua_plugin->msg_handler_add (lua_plugin, irc_command,
- weechat_lua_handler, function,
+ irc_command = lua_tostring (lua_current_interpreter, -2);
+ function = lua_tostring (lua_current_interpreter, -1);
+
+ if (!lua_plugin->msg_handler_add (lua_plugin, (char *) irc_command,
+ weechat_lua_handler, (char *) function,
(void *)lua_current_script))
{
lua_pushnumber (lua_current_interpreter, 0);
diff --git a/weechat/src/plugins/scripts/lua/weechat-lua.c b/weechat/src/plugins/scripts/lua/weechat-lua.c
index 198b6bbd5..1b4d41688 100644
--- a/weechat/src/plugins/scripts/lua/weechat-lua.c
+++ b/weechat/src/plugins/scripts/lua/weechat-lua.c
@@ -341,7 +341,7 @@ weechat_lua_add_message_handler (lua_State *L)
/* make gcc happy */
(void) L;
- char *irc_command, *function;
+ const char *irc_command, *function;
if (!lua_current_script)
{
@@ -366,8 +366,11 @@ weechat_lua_add_message_handler (lua_State *L)
return 1;
}
- if (!lua_plugin->msg_handler_add (lua_plugin, irc_command,
- weechat_lua_handler, function,
+ irc_command = lua_tostring (lua_current_interpreter, -2);
+ function = lua_tostring (lua_current_interpreter, -1);
+
+ if (!lua_plugin->msg_handler_add (lua_plugin, (char *) irc_command,
+ weechat_lua_handler, (char *) function,
(void *)lua_current_script))
{
lua_pushnumber (lua_current_interpreter, 0);