mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 05:21:10 +00:00
Merge branch 'obsd-master'
This commit is contained in:
7
paste.c
7
paste.c
@ -274,7 +274,7 @@ paste_set(char *data, size_t size, const char *name, char **cause)
|
||||
|
||||
/* Convert start of buffer into a nice string. */
|
||||
char *
|
||||
paste_make_sample(struct paste_buffer *pb, int utf8flag)
|
||||
paste_make_sample(struct paste_buffer *pb)
|
||||
{
|
||||
char *buf;
|
||||
size_t len, used;
|
||||
@ -286,10 +286,7 @@ paste_make_sample(struct paste_buffer *pb, int utf8flag)
|
||||
len = width;
|
||||
buf = xreallocarray(NULL, len, 4 + 4);
|
||||
|
||||
if (utf8flag)
|
||||
used = utf8_strvis(buf, pb->data, len, flags);
|
||||
else
|
||||
used = strvisx(buf, pb->data, len, flags);
|
||||
used = utf8_strvis(buf, pb->data, len, flags);
|
||||
if (pb->size > width || used > width)
|
||||
strlcpy(buf + width, "...", 4);
|
||||
return (buf);
|
||||
|
Reference in New Issue
Block a user