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

Diff for /src/usr.bin/tmux/paste.c between version 1.8 and 1.9

version 1.8, 2009/12/03 22:50:10 version 1.9, 2010/06/21 21:44:09
Line 20 
Line 20 
 #include <sys/time.h>  #include <sys/time.h>
   
 #include <string.h>  #include <string.h>
   #include <vis.h>
   
 #include "tmux.h"  #include "tmux.h"
   
Line 155 
Line 156 
         pb->size = size;          pb->size = size;
   
         return (0);          return (0);
   }
   
   /* Convert a buffer into a visible string. */
   char *
   paste_print(struct paste_buffer *pb, size_t width)
   {
           char    *buf;
           size_t   len, used;
   
           if (width < 3)
                   width = 3;
           buf = xmalloc(width * 4 + 1);
   
           len = pb->size;
           if (len > width)
                   len = width;
   
           used = strvisx(buf, pb->data, len, VIS_OCTAL|VIS_TAB|VIS_NL);
           if (pb->size > width || used > width) {
                   buf[width - 3] = '\0';
                   strlcat(buf, "...", width);
           }
   
           return (buf);
 }  }

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9