Ignore:
Timestamp:
Mar 24, 2009, 1:58:01 AM (11 years ago)
Author:
Sam Hocevar
Message:

Apparently \033 is more common than \x1b for ESC. Use the former in our
code for clarity.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/codec/import.c

    r2962 r3412  
    111111        /* If we find ESC[ argv, we guess it's an ANSI file */
    112112        for(i = 0; i + 1 < len; i++)
    113             if((str[i] == 0x1b) && (str[i + 1] == '['))
     113            if((str[i] == '\033') && (str[i + 1] == '['))
    114114                return import_ansi(cv, data, len, 0);
    115115
     
    456456        /* If there are not enough characters to parse the escape sequence,
    457457         * wait until the next try. We require 3. */
    458         else if(buffer[i] == '\x1b' && i + 2 >= size)
     458        else if(buffer[i] == '\033' && i + 2 >= size)
    459459            break;
    460460
    461461        /* XXX: What the fuck is this shit? */
    462         else if(buffer[i] == '\x1b' && buffer[i + 1] == '('
     462        else if(buffer[i] == '\033' && buffer[i + 1] == '('
    463463                 && buffer[i + 2] == 'B')
    464464        {
     
    468468        /* Interpret escape commands, as per Standard ECMA-48 "Control
    469469         * Functions for Coded Character Sets", 5.4. Control sequences. */
    470         else if(buffer[i] == '\x1b' && buffer[i + 1] == '[')
     470        else if(buffer[i] == '\033' && buffer[i + 1] == '[')
    471471        {
    472472            unsigned int argc = 0, argv[101];
     
    642642
    643643        /* Parse OSC stuff. */
    644         else if(buffer[i] == '\x1b' && buffer[i + 1] == ']')
     644        else if(buffer[i] == '\033' && buffer[i + 1] == ']')
    645645        {
    646646            char *string;
Note: See TracChangeset for help on using the changeset viewer.