diff options
author | mat <mat@FreeBSD.org> | 2016-08-04 21:19:34 +0800 |
---|---|---|
committer | mat <mat@FreeBSD.org> | 2016-08-04 21:19:34 +0800 |
commit | 3d2915e4033983a0ec472918e2c52a12712b6bfa (patch) | |
tree | fc4e173b6b38aefb25e59aed5c188acf3d9a28c1 /sysutils/tmux | |
parent | 675b555011091f702274e38fb4cf546e61740af3 (diff) | |
download | freebsd-ports-gnome-3d2915e4033983a0ec472918e2c52a12712b6bfa.tar.gz freebsd-ports-gnome-3d2915e4033983a0ec472918e2c52a12712b6bfa.tar.zst freebsd-ports-gnome-3d2915e4033983a0ec472918e2c52a12712b6bfa.zip |
Fix some Unicode characters not displaying correctly.
PR: 211499
Submitted by: Oleg Gushchenkov
Obtained from: https://github.com/tmux/tmux/commit/65e4c57d3a554940ed5cada6dfeff403ae8d9572
Sponsored by: Absolight
Diffstat (limited to 'sysutils/tmux')
-rw-r--r-- | sysutils/tmux/Makefile | 1 | ||||
-rw-r--r-- | sysutils/tmux/files/patch-utf8.c | 34 |
2 files changed, 35 insertions, 0 deletions
diff --git a/sysutils/tmux/Makefile b/sysutils/tmux/Makefile index bbeb050986b5..a065ba65f1e0 100644 --- a/sysutils/tmux/Makefile +++ b/sysutils/tmux/Makefile @@ -3,6 +3,7 @@ PORTNAME= tmux PORTVERSION= 2.2 +PORTREVISION= 1 CATEGORIES= sysutils MASTER_SITES= https://github.com/tmux/tmux/releases/download/${PORTVERSION}/ DISTFILES= ${DISTNAME}${EXTRACT_SUFX} diff --git a/sysutils/tmux/files/patch-utf8.c b/sysutils/tmux/files/patch-utf8.c new file mode 100644 index 000000000000..68c21ae0f9ac --- /dev/null +++ b/sysutils/tmux/files/patch-utf8.c @@ -0,0 +1,34 @@ +commit 65e4c57d3a554940ed5cada6dfeff403ae8d9572 +Author: Nicholas Marriott <nicholas.marriott@gmail.com> +Date: 2016-04-29 12:47:15 +0100 + + Only assume width 1 when wcwidth() returns -1 on non-OpenBSD platforms. + +--- utf8.c.orig 2016-03-02 18:29:06 UTC ++++ utf8.c +@@ -115,8 +115,24 @@ utf8_width(wchar_t wc) + int width; + + width = wcwidth(wc); +- if (width < 0 || width > 0xff) ++ if (width < 0 || width > 0xff) { ++ log_debug("Unicode %04x, wcwidth() %d", wc, width); ++ ++#ifndef __OpenBSD__ ++ /* ++ * Many platforms (particularly and inevitably OS X) have no ++ * width for relatively common characters (wcwidth() returns ++ * -1); assume width 1 in this case. This will be wrong for ++ * genuinely nonprintable characters, but they should be ++ * rare. We may pass through stuff that ideally we would block, ++ * but this is no worse than sending the same to the terminal ++ * without tmux. ++ */ ++ if (width < 0) ++ return (1); ++#endif + return (-1); ++ } + return (width); + } + |