mirror of
https://github.com/irssi/irssi.git
synced 2026-08-20 17:12:51 +02:00
if printformat() was given a argument ending with ^C it could mess up
one or two chars of the following text (part/quit messages). git-svn-id: http://svn.irssi.org/repos/irssi/trunk@676 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
91b4c3af46
commit
3d627ca527
1 changed files with 10 additions and 0 deletions
|
|
@ -385,8 +385,18 @@ static char *output_format_text_args(TEXT_DEST_REC *dest, FORMAT_REC *format,
|
||||||
|
|
||||||
ret = parse_special((char **) &str, active_win->active_server,
|
ret = parse_special((char **) &str, active_win->active_server,
|
||||||
active_win->active, arglist, &need_free, NULL);
|
active_win->active, arglist, &need_free, NULL);
|
||||||
|
|
||||||
if (ret != NULL) {
|
if (ret != NULL) {
|
||||||
|
/* string shouldn't end with \003 or it could
|
||||||
|
mess up the next one or two characters */
|
||||||
|
int diff;
|
||||||
|
int len = strlen(ret);
|
||||||
|
while (len > 0 && ret[len-1] == 3) len--;
|
||||||
|
diff = strlen(ret)-len;
|
||||||
|
|
||||||
g_string_append(out, ret);
|
g_string_append(out, ret);
|
||||||
|
if (diff > 0)
|
||||||
|
g_string_truncate(out, out->len-diff);
|
||||||
if (need_free) g_free(ret);
|
if (need_free) g_free(ret);
|
||||||
}
|
}
|
||||||
code = 0;
|
code = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue