1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-25 20:36:38 +02:00

Add "replacement" argument for string_remove_color in plugin API

This commit is contained in:
Sebastien Helleu
2009-03-18 18:02:48 +01:00
parent 5f243ddd86
commit a394ed5d6f
17 changed files with 160 additions and 87 deletions
+5 -4
View File
@@ -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);
}