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

Diff for /src/usr.bin/tmux/tty.c between version 1.382 and 1.383

version 1.382, 2020/06/05 09:32:15 version 1.383, 2020/09/02 13:46:36
Line 1896 
Line 1896 
 void  void
 tty_cmd_setselection(struct tty *tty, const struct tty_ctx *ctx)  tty_cmd_setselection(struct tty *tty, const struct tty_ctx *ctx)
 {  {
         char    *buf;          tty_set_selection(tty, ctx->ptr, ctx->num);
         size_t   off;  }
   
   void
   tty_set_selection(struct tty *tty, const char *buf, size_t len)
   {
           char    *encoded;
           size_t   size;
   
         if (!tty_term_has(tty->term, TTYC_MS))          if (!tty_term_has(tty->term, TTYC_MS))
                 return;                  return;
           if (~tty->flags & TTY_STARTED)
                   return;
   
         off = 4 * ((ctx->num + 2) / 3) + 1; /* storage for base64 */          size = 4 * ((len + 2) / 3) + 1; /* storage for base64 */
         buf = xmalloc(off);          encoded = xmalloc(size);
   
         b64_ntop(ctx->ptr, ctx->num, buf, off);          b64_ntop(buf, len, encoded, size);
         tty_putcode_ptr2(tty, TTYC_MS, "", buf);          tty_putcode_ptr2(tty, TTYC_MS, "", encoded);
   
         free(buf);          free(encoded);
 }  }
   
 void  void

Legend:
Removed from v.1.382  
changed lines
  Added in v.1.383