Changeset 2453


Ignore:
Timestamp:
Jun 18, 2008, 11:42:50 PM (12 years ago)
Author:
Pascal Terjan
Message:
  • Oops revert parts of 2451 which should not have been commited
Location:
neercs/trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • neercs/trunk/src/main.c

    r2451 r2453  
    211211        if(ret && (caca_get_event_type(&ev) & CACA_EVENT_KEY_PRESS))
    212212        {
    213             unsigned int c = caca_get_event_key_utf32(&ev);
     213            unsigned int c = caca_get_event_key_ch(&ev);
    214214
    215215            if(command)
  • neercs/trunk/src/neercs.h

    r2451 r2453  
    170170
    171171
    172 #if 1
     172#if 0
    173173#   define debug(f, z...) fprintf(stderr, f "\n", z)
    174174#else
  • neercs/trunk/src/term.c

    r2451 r2453  
    344344        {
    345345            unsigned int bytes;
    346             char tmp[7];
    347346
    348347            if(i + 6 < size)
     
    351350            {
    352351                /* Add a trailing zero to what we're going to read */
     352                char tmp[7];
    353353                memcpy(tmp, buffer + i, size - i);
    354354                tmp[size - i] = '\0';
    355355                ch = cucul_utf8_to_utf32(tmp, &bytes);
    356356            }
    357             /* FIXME awful for perfs
    358                should get a better way to know if utf8 was valid */
    359             memset(tmp, 0, 7);
    360             cucul_utf32_to_utf8(tmp, ch);
    361             if(strncmp(tmp, (char const *)(buffer + i), strlen(tmp)))
    362                 bytes = 0;
     357
    363358            if(!bytes)
    364359            {
    365360                /* If the Unicode is invalid, assume it was latin1. */
    366361                ch = buffer[i];
    367                 debug("Invalid UTF-8 : %c", ch);
    368362                bytes = 1;
    369363            }
Note: See TracChangeset for help on using the changeset viewer.