summaryrefslogtreecommitdiff
path: root/src/plugins/scripts/lua
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2009-03-18 18:02:48 +0100
committerSebastien Helleu <flashcode@flashtux.org>2009-03-18 18:02:48 +0100
commita394ed5d6fcb54970d5453de02ce228c35ddd9bb (patch)
tree1f898f7982bb8ca0479470ecd64246114efb5d76 /src/plugins/scripts/lua
parent5f243ddd8690adeab4cc4511deb46319ca071234 (diff)
downloadweechat-a394ed5d6fcb54970d5453de02ce228c35ddd9bb.zip
Add "replacement" argument for string_remove_color in plugin API
Diffstat (limited to 'src/plugins/scripts/lua')
-rw-r--r--src/plugins/scripts/lua/weechat-lua-api.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/plugins/scripts/lua/weechat-lua-api.c b/src/plugins/scripts/lua/weechat-lua-api.c
index 0f0d50fa8..9271d9ce4 100644
--- a/src/plugins/scripts/lua/weechat-lua-api.c
+++ b/src/plugins/scripts/lua/weechat-lua-api.c
@@ -371,7 +371,7 @@ weechat_lua_api_ngettext (lua_State *L)
static int
weechat_lua_api_string_remove_color (lua_State *L)
{
- const char *string;
+ const char *string, *replacement;
char *result;
int n;
@@ -388,15 +388,16 @@ weechat_lua_api_string_remove_color (lua_State *L)
n = lua_gettop (lua_current_interpreter);
- if (n < 1)
+ if (n < 2)
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("string_remove_color");
LUA_RETURN_EMPTY;
}
- string = lua_tostring (lua_current_interpreter, -1);
+ string = lua_tostring (lua_current_interpreter, -2);
+ replacement = lua_tostring (lua_current_interpreter, -1);
- result = weechat_string_remove_color (string);
+ result = weechat_string_remove_color (string, replacement);
LUA_RETURN_STRING_FREE(result);
}