Show
Ignore:
Timestamp:
08/19/07 18:31:07 (15 months ago)
Author:
krobillard
Message:

Tokenizer handles special char!.
ur_toStrT() now thread-safe for char! values.
Fixed Vim char! syntax.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/thune/thread_safe/print.c

    r450 r452  
    3232 
    3333extern int copyUtf16ToAscii( char* dest, const uint16_t* src, int len ); 
    34  
    35  
    36 static char charStr[] = "'?'"; 
    3734 
    3835 
     
    10471044            switch( ur_int(val) ) 
    10481045            { 
    1049                 case '\0': 
    1050                     append( out, "'^0'", 4 ); 
    1051                     break; 
    1052  
    10531046                case '\a': 
    10541047                    append( out, "'^(bell)'", 9 ); 
     
    10801073 
    10811074                default: 
    1082                     charStr[1] = (char) ur_int(val); 
    1083                     append(out, charStr, 3); 
     1075                { 
     1076                    char cstr[ 4 ]; 
     1077                    cstr[0] = '\''; 
     1078                    if( ur_int(val) < 10 ) 
     1079                    { 
     1080                        cstr[1] = '^'; 
     1081                        cstr[2] = ur_int(val) + '0'; 
     1082                        cstr[3] = '\''; 
     1083                        append( out, cstr, 4 ); 
     1084                    } 
     1085                    else 
     1086                    { 
     1087                        cstr[1] = (char) ur_int(val); 
     1088                        cstr[2] = '\''; 
     1089                        append(out, cstr, 3); 
     1090                    } 
     1091                } 
    10841092                    break; 
    10851093            }