=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/key-string.c,v retrieving revision 1.31 retrieving revision 1.32 diff -c -r1.31 -r1.32 *** src/usr.bin/tmux/key-string.c 2015/11/14 10:57:59 1.31 --- src/usr.bin/tmux/key-string.c 2015/11/14 11:45:43 1.32 *************** *** 1,4 **** ! /* $OpenBSD: key-string.c,v 1.31 2015/11/14 10:57:59 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: key-string.c,v 1.32 2015/11/14 11:45:43 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 144,153 **** static const char *other = "!#()+,-.0123456789:;<=>?'\r\t"; key_code key; u_short u; ! int size, more; key_code modifiers; struct utf8_data ud; u_int i; /* Is this a hexadecimal value? */ if (string[0] == '0' && string[1] == 'x') { --- 144,154 ---- static const char *other = "!#()+,-.0123456789:;<=>?'\r\t"; key_code key; u_short u; ! int size; key_code modifiers; struct utf8_data ud; u_int i; + enum utf8_state more; /* Is this a hexadecimal value? */ if (string[0] == '0' && string[1] == 'x') { *************** *** 173,185 **** return (KEYC_NONE); } else { /* Try as a UTF-8 key. */ ! if (utf8_open(&ud, (u_char)*string)) { if (strlen(string) != ud.size) return (KEYC_NONE); - more = 1; for (i = 1; i < ud.size; i++) more = utf8_append(&ud, (u_char)string[i]); ! if (more != 0) return (KEYC_NONE); key = utf8_combine(&ud); return (key | modifiers); --- 174,185 ---- return (KEYC_NONE); } else { /* Try as a UTF-8 key. */ ! if ((more = utf8_open(&ud, (u_char)*string)) == UTF8_MORE) { if (strlen(string) != ud.size) return (KEYC_NONE); for (i = 1; i < ud.size; i++) more = utf8_append(&ud, (u_char)string[i]); ! if (more != UTF8_DONE) return (KEYC_NONE); key = utf8_combine(&ud); return (key | modifiers); *************** *** 256,262 **** /* Is this a UTF-8 key? */ if (key > 127 && key < KEYC_BASE) { ! if (utf8_split(key, &ud) == 0) { memcpy(out, ud.data, ud.size); out[ud.size] = '\0'; return (out); --- 256,262 ---- /* Is this a UTF-8 key? */ if (key > 127 && key < KEYC_BASE) { ! if (utf8_split(key, &ud) == UTF8_DONE) { memcpy(out, ud.data, ud.size); out[ud.size] = '\0'; return (out);