From b9b0917897bd3b78d105c3229deb390daa204cdd Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Wed, 19 Jun 2002 03:06:05 +0000 Subject: [PATCH] strip_codes() didn't handle ANSI colors properly, and if used at the end of line it might have crashed irssi (especially with topics). yeah, remote crash. great. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2856 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-common/core/formats.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/fe-common/core/formats.c b/src/fe-common/core/formats.c index 983a849e..06464894 100644 --- a/src/fe-common/core/formats.c +++ b/src/fe-common/core/formats.c @@ -907,9 +907,8 @@ char *strip_codes(const char *input) if (*p == 27 && p[1] != '\0') { p++; p = get_ansi_color(current_theme, p, NULL, NULL, NULL); - } - - if (!IS_COLOR_CODE(*p)) + p--; + } else if (!IS_COLOR_CODE(*p)) *out++ = *p; }