1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-01 15:26: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
@@ -443,7 +443,7 @@ weechat_tcl_api_string_remove_color (ClientData clientData, Tcl_Interp *interp,
int objc, Tcl_Obj *CONST objv[])
{
Tcl_Obj* objp;
char *result, *string;
char *result, *replacement, *string;
int i;
/* make C compiler happy */
@@ -455,14 +455,15 @@ weechat_tcl_api_string_remove_color (ClientData clientData, Tcl_Interp *interp,
TCL_RETURN_EMPTY;
}
if (objc < 2)
if (objc < 3)
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("string_remove_color");
TCL_RETURN_EMPTY;
}
string = Tcl_GetStringFromObj (objv[1], &i);
result = weechat_string_remove_color (string);
replacement = Tcl_GetStringFromObj (objv[2], &i);
result = weechat_string_remove_color (string, replacement);
TCL_RETURN_STRING_FREE(result);
}