From 062d8871369884fc7a0e7f983a44d0aa593e5e0a Mon Sep 17 00:00:00 2001 From: scw Date: Sat, 10 Jan 2004 14:45:10 +0000 Subject: Missing commit. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1480 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/io.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/io.c b/mbbsd/io.c index d158575c..829386f8 100644 --- a/mbbsd/io.c +++ b/mbbsd/io.c @@ -375,7 +375,7 @@ strip_ansi(char *buf, char *str, int mode) /* 20 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 30 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, /* 0~9 ;= */ /* 40 */ 0, 2, 2, 2, 2, 0, 0, 0, 2, 2, 2, 2, 0, 0, 0, 0, /* ABCDHIJK */ - /* 50 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, /* [ */ + /* 50 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 60 */ 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 2, 2, 0, 0, /* fhlm */ /* 70 */ 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* su */ /* 80 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -396,18 +396,22 @@ strip_ansi(char *buf, char *str, int mode) *buf++ = *str; ++count; }else{ - register char* p = str; + register char* p = str + 1; + if( *p != '[' ){ + ++str; + continue; + } while(isEscapeParam(*++p)); if( (mode == NO_RELOAD && isEscapeCommand(*p)) || (mode == ONLY_COLOR && *p == 'm' )){ - register int len = p - str; + register int len = p - str + 1; if( buf ){ strncpy(buf, str, len); buf += len; } count += len; } - str = p - 1; + str = p; } if( buf ) *buf = 0; -- cgit v1.2.3