system/kernel/simul_efun/color.c
// calculate the color char in a string
calculate the color char in a string
calculate the color char in a string
int color_len(string str)
{
    int i, extra;
    extra = 0;
    for (i = 0; i < strlen(str); i++)
    {
        if (str[i] == ESC[0])
        {
            while ((extra++, str[i] != 'm') && i < strlen(str))
                i++;
        }
    }
    return extra;
}
int color_len ( string str ) { int i , extra ; extra = 0 ; for ( i = 0 ; i < strlen ( str ) ; i ++ ) { if ( str [ i ] == ESC [ 0 ] ) { while ( ( extra ++ , str [ i ] != ' ' ) && i < strlen ( str ) ) i ++ ; } } return extra ; }
calculate the color char in a string
calculate the color char in a string