Changeset e0ffe77 for editwin.c


Ignore:
Timestamp:
Jan 16, 2008, 8:18:25 PM (13 years ago)
Author:
Alejandro R. Sedeño <asedeno@mit.edu>
Branches:
master, barnowl_perlaim, debian, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
367fbf3
Parents:
b7b2a76
Message:
editwin.c: make locktext deal with UTF-8

Jabber - 
More utf-8 sanitizing.
New helper function to validate strings from C and set the utf8 flag if needed.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • editwin.c

    rb7b4565 re0ffe77  
    148148  /*  e->buffx=x; */
    149149  /*  e->buffy=y; */
    150   owl_editwin_adjust_for_locktext(e);
     150  _owl_editwin_set_xy_by_index(e, e->lock);
    151151  owl_editwin_redisplay(e, 0);
    152152}
     
    292292    int len;
    293293    int dolocklen = e->lock - (ptr1 - e->buff);
    294 
    295     for (i = 0; i < dolocklen; i++) {
    296       waddch(e->curswin, buff[i]);
    297     }
     294    char *locktext;
     295    char tmp = e->buff[dolocklen];
     296
     297    e->buff[dolocklen] = '\0';
     298    locktext = owl_strdup(e->buff);
     299    e->buff[dolocklen] = tmp;
     300
     301    waddstr(e->curswin, locktext);
     302   
    298303    len = strlen(buff);
    299304    for (i = 0; i < len-dolocklen; i++) {
Note: See TracChangeset for help on using the changeset viewer.