[BACK]Return to tty-keys.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tmux

Diff for /src/usr.bin/tmux/tty-keys.c between version 1.79 and 1.80

version 1.79, 2015/11/14 10:57:59 version 1.80, 2015/11/14 11:45:43
Line 472 
Line 472 
         const char              *buf;          const char              *buf;
         size_t                   len, size;          size_t                   len, size;
         cc_t                     bspace;          cc_t                     bspace;
         int                      delay, expired = 0, more;          int                      delay, expired = 0;
         key_code                 key;          key_code                 key;
         struct utf8_data         ud;          struct utf8_data         ud;
           enum utf8_state          more;
         u_int                    i;          u_int                    i;
   
         /* Get key buffer. */          /* Get key buffer. */
Line 539 
Line 540 
         }          }
   
         /* Is this valid UTF-8? */          /* Is this valid UTF-8? */
         if (utf8_open(&ud, (u_char)*buf)) {          if ((more = utf8_open(&ud, (u_char)*buf) == UTF8_MORE)) {
                 size = ud.size;                  size = ud.size;
                 if (len < size) {                  if (len < size) {
                         if (expired)                          if (expired)
                                 goto discard_key;                                  goto discard_key;
                         goto partial_key;                          goto partial_key;
                 }                  }
                 more = 1;  
                 for (i = 1; i < size; i++)                  for (i = 1; i < size; i++)
                         more = utf8_append(&ud, (u_char)buf[i]);                          more = utf8_append(&ud, (u_char)buf[i]);
                 if (more != 0)                  if (more != UTF8_DONE)
                         goto discard_key;                          goto discard_key;
                 key = utf8_combine(&ud);                  key = utf8_combine(&ud);
                 log_debug("UTF-8 key %.*s %#llx", (int)size, buf, key);                  log_debug("UTF-8 key %.*s %#llx", (int)size, buf, key);
Line 656 
Line 656 
         struct utf8_data         ud;          struct utf8_data         ud;
         u_int                    i, value, x, y, b, sgr_b;          u_int                    i, value, x, y, b, sgr_b;
         u_char                   sgr_type, c;          u_char                   sgr_type, c;
         int                      more;          enum utf8_state          more;
   
         /*          /*
          * Standard mouse sequences are \033[M followed by three characters           * Standard mouse sequences are \033[M followed by three characters
Line 697 
Line 697 
                                 return (1);                                  return (1);
   
                         if (tty->mode & MODE_MOUSE_UTF8) {                          if (tty->mode & MODE_MOUSE_UTF8) {
                                 if (utf8_open(&ud, buf[*size])) {                                  if (utf8_open(&ud, buf[*size]) == UTF8_MORE) {
                                         if (ud.size != 2)                                          if (ud.size != 2)
                                                 return (-1);                                                  return (-1);
                                         (*size)++;                                          (*size)++;
                                         if (len <= *size)                                          if (len <= *size)
                                                 return (1);                                                  return (1);
                                         more = utf8_append(&ud, buf[*size]);                                          more = utf8_append(&ud, buf[*size]);
                                         if (more != 0)                                          if (more != UTF8_DONE)
                                                 return (-1);                                                  return (-1);
                                         value = utf8_combine(&ud);                                          value = utf8_combine(&ud);
                                 } else                                  } else

Legend:
Removed from v.1.79  
changed lines
  Added in v.1.80