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

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

Location:
libcaca/trunk/caca
Files:
3 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;
  • libcaca/trunk/caca/driver/win32.c

    r3168 r3412  
    285285                case VK_TAB:        ev->data.key.ch = '\t';              break;
    286286                case VK_RETURN:     ev->data.key.ch = '\r';              break;
    287                 case VK_ESCAPE:     ev->data.key.ch = '\x1b';            break;
     287                case VK_ESCAPE:     ev->data.key.ch = '\033';            break;
    288288                case VK_SPACE:      ev->data.key.ch = ' ';               break;
    289289                case VK_DELETE:     ev->data.key.ch = '\x7f';            break;
  • libcaca/trunk/caca/graphics.c

    r2821 r3412  
    262262#endif
    263263
    264     fprintf(stdout, "\x1b]0;%s\x07", str);
     264    fprintf(stdout, "\033]0;%s\007", str);
    265265    fflush(stdout);
    266266}
Note: See TracChangeset for help on using the changeset viewer.