mirror of
https://github.com/tmux/tmux.git
synced 2026-05-30 14:16:18 +00:00
Pass paste buffer through vis(3) when pasting to prevent buffers
containing for example the bracket end sequence causing issues. -S flag disables. Reported by Mason Davis.
This commit is contained in:
10
utf8.c
10
utf8.c
@@ -639,7 +639,7 @@ utf8_append(struct utf8_data *ud, u_char ch)
|
||||
* bytes available for each character from src (for \abc or UTF-8) plus space
|
||||
* for \0.
|
||||
*/
|
||||
int
|
||||
size_t
|
||||
utf8_strvis(char *dst, const char *src, size_t len, int flag)
|
||||
{
|
||||
struct utf8_data ud;
|
||||
@@ -677,11 +677,11 @@ utf8_strvis(char *dst, const char *src, size_t len, int flag)
|
||||
}
|
||||
|
||||
/* Same as utf8_strvis but allocate the buffer. */
|
||||
int
|
||||
size_t
|
||||
utf8_stravis(char **dst, const char *src, int flag)
|
||||
{
|
||||
char *buf;
|
||||
int len;
|
||||
size_t len;
|
||||
|
||||
buf = xreallocarray(NULL, 4, strlen(src) + 1);
|
||||
len = utf8_strvis(buf, src, strlen(src), flag);
|
||||
@@ -691,11 +691,11 @@ utf8_stravis(char **dst, const char *src, int flag)
|
||||
}
|
||||
|
||||
/* Same as utf8_strvis but allocate the buffer. */
|
||||
int
|
||||
size_t
|
||||
utf8_stravisx(char **dst, const char *src, size_t srclen, int flag)
|
||||
{
|
||||
char *buf;
|
||||
int len;
|
||||
size_t len;
|
||||
|
||||
buf = xreallocarray(NULL, 4, srclen + 1);
|
||||
len = utf8_strvis(buf, src, srclen, flag);
|
||||
|
||||
Reference in New Issue
Block a user