summaryrefslogtreecommitdiff
path: root/src/fe-common/core
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-06-19 03:06:05 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-06-19 03:06:05 +0000
commitb9b0917897bd3b78d105c3229deb390daa204cdd (patch)
treee91f59156bbe9d6c0f6afa3a3ca15c1a0a44eada /src/fe-common/core
parent8856d9fc3ddfd86280f2335732d30044fa3931f2 (diff)
downloadirssi-b9b0917897bd3b78d105c3229deb390daa204cdd.zip
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
Diffstat (limited to 'src/fe-common/core')
-rw-r--r--src/fe-common/core/formats.c5
1 files 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;
}