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

Diff for /src/usr.bin/tmux/input.c between version 1.199 and 1.200

version 1.199, 2022/02/15 13:11:29 version 1.200, 2022/03/08 12:01:19
Line 2682 
Line 2682 
 {  {
         struct window_pane      *wp = ictx->wp;          struct window_pane      *wp = ictx->wp;
         char                    *end;          char                    *end;
         const char              *buf;          const char              *buf = NULL;
         size_t                   len;          size_t                   len = 0;
         u_char                  *out;          u_char                  *out;
         int                      outlen, state;          int                      outlen, state;
         struct screen_write_ctx  ctx;          struct screen_write_ctx  ctx;
Line 2703 
Line 2703 
         log_debug("%s: %s", __func__, end);          log_debug("%s: %s", __func__, end);
   
         if (strcmp(end, "?") == 0) {          if (strcmp(end, "?") == 0) {
                 if ((pb = paste_get_top(NULL)) != NULL) {                  if ((pb = paste_get_top(NULL)) != NULL)
                         buf = paste_buffer_data(pb, &len);                          buf = paste_buffer_data(pb, &len);
                         outlen = 4 * ((len + 2) / 3) + 1;  
                         out = xmalloc(outlen);  
                         if ((outlen = b64_ntop(buf, len, out, outlen)) == -1) {  
                                 free(out);  
                                 return;  
                         }  
                 } else {  
                         outlen = 0;  
                         out = NULL;  
                 }  
                 bufferevent_write(ictx->event, "\033]52;;", 6);  
                 if (outlen != 0)  
                         bufferevent_write(ictx->event, out, outlen);  
                 if (ictx->input_end == INPUT_END_BEL)                  if (ictx->input_end == INPUT_END_BEL)
                         bufferevent_write(ictx->event, "\007", 1);                          input_reply_clipboard(ictx->event, buf, len, "\007");
                 else                  else
                         bufferevent_write(ictx->event, "\033\\", 2);                          input_reply_clipboard(ictx->event, buf, len, "\033\\");
                 free(out);  
                 return;                  return;
         }          }
   
Line 2779 
Line 2765 
         if (redraw)          if (redraw)
                 screen_write_fullredraw(&ictx->ctx);                  screen_write_fullredraw(&ictx->ctx);
         free(copy);          free(copy);
   }
   
   void
   input_reply_clipboard(struct bufferevent *bev, const char *buf, size_t len,
       const char *end)
   {
           char    *out = NULL;
           size_t   outlen = 0;
   
           if (buf != NULL && len != 0) {
                   outlen = 4 * ((len + 2) / 3) + 1;
                   out = xmalloc(outlen);
                   if ((outlen = b64_ntop(buf, len, out, outlen)) == -1) {
                           free(out);
                           return;
                   }
           }
   
           bufferevent_write(bev, "\033]52;;", 6);
           if (outlen != 0)
                   bufferevent_write(bev, out, outlen);
           bufferevent_write(bev, end, strlen(end));
           free(out);
 }  }

Legend:
Removed from v.1.199  
changed lines
  Added in v.1.200