# HG changeset patch # User Eric Warmenhoven # Date 984628165 0 # Node ID bbdc5eefd243054cb12bd40ff96aa0e3431dac93 # Parent 4a47a459cc984dbd46004f8b72d163e34aab8b35 [gaim-migrate @ 1581] ignore "\033[..?m" committer: Tailor Script diff -r 4a47a459cc98 -r bbdc5eefd243 plugins/yay/yay.c --- a/plugins/yay/yay.c Wed Mar 14 20:11:04 2001 +0000 +++ b/plugins/yay/yay.c Thu Mar 15 03:49:25 2001 +0000 @@ -134,6 +134,8 @@ struct gaim_connection *gc = sess->user_data; struct yahoo_data *yd = (struct yahoo_data *)gc->proto_data; char buf[BUF_LEN * 4]; + char *tmp, *c, *e; + int at = 0; va_list ap; char *id, *nick, *msg; @@ -144,7 +146,20 @@ msg = va_arg(ap, char *); va_end(ap); - g_snprintf(buf, sizeof(buf), "%s", msg); + e = tmp = g_strdup(msg); + + while ((c = strchr(e, '\033')) != NULL) { + *c++ = '\0'; + at += g_snprintf(buf + at, sizeof(buf) - at, "%s", e); + e = ++c; + while (*e && (*e++ != 'm')); + } + + if (*e) + g_snprintf(buf + at, sizeof(buf) - at, "%s", e); + + g_free(tmp); + serv_got_im(gc, nick, buf, 0); return 1;