diff options
Diffstat (limited to 'mbbsd/io.c')
-rw-r--r-- | mbbsd/io.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -642,9 +642,9 @@ wait_input(float f, int flDoRefresh) * @param buf * @param str * @param mode enum {STRIP_ALL = 0, ONLY_COLOR, NO_RELOAD}; - * STRIP_ALL: ?? - * ONLY_COLOR: ?? - * NO_RELOAD: 不 strip (?) + * STRIP_ALL: 全部吃掉 + * ONLY_COLOR: 只吃掉跟顏色有關的 (ESC[*m) + * NO_RELOAD: 不 strip (?) */ static const char EscapeFlag[] = { /* 0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -664,7 +664,7 @@ static const char EscapeFlag[] = { /* E0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* F0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; -#define isEscapeParam(X) (EscapeFlag[(int)(X)] & 1) +#define isEscapeParam(X) (EscapeFlag[(int)(X)] & 1) #define isEscapeCommand(X) (EscapeFlag[(int)(X)] & 2) int @@ -705,6 +705,8 @@ strip_ansi(char *buf, const char *str, int mode) int strlen_noansi(const char *s) { + // XXX this is almost identical to + // strip_ansi(NULL, s, STRIP_ALL) register int count = 0, mode = 0; if (!s || !*s) |