mirror of
https://github.com/weechat/weechat.git
synced 2026-06-27 13:26:38 +02:00
perl: do not update message argument in function weechat_perl_output (issue #128)
This commit is contained in:
@@ -278,7 +278,7 @@ weechat_perl_output_flush ()
|
||||
|
||||
XS (weechat_perl_output)
|
||||
{
|
||||
char *msg, *ptr_msg, *ptr_newline;
|
||||
char *msg, *ptr_msg, *ptr_newline, *message;
|
||||
dXSARGS;
|
||||
|
||||
if (items < 1)
|
||||
@@ -288,10 +288,11 @@ XS (weechat_perl_output)
|
||||
ptr_msg = msg;
|
||||
while ((ptr_newline = strchr (ptr_msg, '\n')) != NULL)
|
||||
{
|
||||
ptr_newline[0] = '\0';
|
||||
weechat_string_dyn_concat (perl_buffer_output, ptr_msg);
|
||||
message = weechat_strndup (ptr_msg, ptr_newline - ptr_msg);
|
||||
weechat_string_dyn_concat (perl_buffer_output, message);
|
||||
if (message)
|
||||
free (message);
|
||||
weechat_perl_output_flush ();
|
||||
ptr_newline[0] = '\n';
|
||||
ptr_msg = ++ptr_newline;
|
||||
}
|
||||
weechat_string_dyn_concat (perl_buffer_output, ptr_msg);
|
||||
|
||||
Reference in New Issue
Block a user