mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 13:37:12 +00:00
Fix show-buffer when run from inside tmux, GitHub issue 2314.
This commit is contained in:
14
utf8.c
14
utf8.c
@ -341,6 +341,20 @@ utf8_stravis(char **dst, const char *src, int flag)
|
||||
return (len);
|
||||
}
|
||||
|
||||
/* Same as utf8_strvis but allocate the buffer. */
|
||||
int
|
||||
utf8_stravisx(char **dst, const char *src, size_t srclen, int flag)
|
||||
{
|
||||
char *buf;
|
||||
int len;
|
||||
|
||||
buf = xreallocarray(NULL, 4, srclen + 1);
|
||||
len = utf8_strvis(buf, src, srclen, flag);
|
||||
|
||||
*dst = xrealloc(buf, len + 1);
|
||||
return (len);
|
||||
}
|
||||
|
||||
/* Does this string contain anything that isn't valid UTF-8? */
|
||||
int
|
||||
utf8_isvalid(const char *s)
|
||||
|
Reference in New Issue
Block a user