1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-01 07:16:37 +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
+4 -3
View File
@@ -316,7 +316,7 @@ static XS (XS_weechat_api_ngettext)
static XS (XS_weechat_api_string_remove_color)
{
char *result, *string;
char *result, *string, *replacement;
dXSARGS;
/* make C compiler happy */
@@ -328,14 +328,15 @@ static XS (XS_weechat_api_string_remove_color)
PERL_RETURN_EMPTY;
}
if (items < 1)
if (items < 2)
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("string_remove_color");
PERL_RETURN_EMPTY;
}
string = SvPV (ST (0), PL_na);
result = weechat_string_remove_color (string);
replacement = SvPV (ST (1), PL_na);
result = weechat_string_remove_color (string, replacement);
PERL_RETURN_STRING_FREE(result);
}