From 1a9a72432baae4700997026eb958c1b71935d895 Mon Sep 17 00:00:00 2001 From: Arnaud Cornet Date: Sat, 8 Dec 2007 16:00:50 +0100 Subject: [PATCH] Fix double arrow prefix for self issued private messages when more that two clients are connected. --- src/irc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/irc.c b/src/irc.c index 1dcea0f..c7f4bb2 100644 --- a/src/irc.c +++ b/src/irc.c @@ -1103,7 +1103,7 @@ static int irc_dispatch_client(bip_t *bip, struct link_client *ic, else if (LINK(ic)->l_server->nick) WRITE_LINE2(CONN(ic), P_IRCMASK, (LINK(ic)->user->bip_use_notice ? - "NOTICE" : "PRIVMSG"), + "NOTICE" : "PRIVMSG"), LINK(ic)->l_server->nick, ":Not connected please try again " "later...\r\n"); @@ -1145,7 +1145,7 @@ static void irc_copy_cli(struct link_client *src, struct link_client *dest, /* LINK(src) == LINK(dest) */ size_t len = strlen(line->elemv[2]) + 5; - char *tmp; + char *tmp, *oldelem; if (len == 0) return; @@ -1159,13 +1159,15 @@ static void irc_copy_cli(struct link_client *src, struct link_client *dest, /* tricky: */ line->elemv[1] = LINK(src)->l_server->nick; - free(line->elemv[2]); + oldelem = line->elemv[2]; line->elemv[2] = tmp; str = irc_line_to_string(line); /* end of trick: */ line->elemv[1] = line->origin; + line->elemv[2] = oldelem; line->origin = NULL; write_line(CONN(dest), str); + free(tmp); free(str); return; }