View | Details | Raw Unified | Return to bug 211499
Collapse All | Expand All

(-)Makefile (+1 lines)
Lines 3-8 Link Here
3
3
4
PORTNAME=	tmux
4
PORTNAME=	tmux
5
PORTVERSION=	2.2
5
PORTVERSION=	2.2
6
PORTREVISION=	1
6
CATEGORIES=	sysutils
7
CATEGORIES=	sysutils
7
MASTER_SITES=	https://github.com/tmux/tmux/releases/download/${PORTVERSION}/
8
MASTER_SITES=	https://github.com/tmux/tmux/releases/download/${PORTVERSION}/
8
DISTFILES=	${DISTNAME}${EXTRACT_SUFX}
9
DISTFILES=	${DISTNAME}${EXTRACT_SUFX}
(-)files/patch-utf8.c (+29 lines)
Line 0 Link Here
1
--- utf8.c.orig	2016-08-01 09:24:01 UTC
2
+++ utf8.c
3
@@ -115,8 +115,25 @@ utf8_width(wchar_t wc)
4
 	int	width;
5
 
6
 	width = wcwidth(wc);
7
-	if (width < 0 || width > 0xff)
8
+	if (width < 0 || width > 0xff) {
9
+		log_debug("Unicode %04x, wcwidth() %d", wc, width);
10
+
11
+#ifndef __OpenBSD__
12
+		/*
13
+		 * Many platforms (particularly and inevitably OS X) have no
14
+		 * width for relatively common characters (wcwidth() returns
15
+		 * -1); assume width 1 in this case. This will be wrong for
16
+		 * genuinely nonprintable characters, but they should be
17
+		 * rare. We may pass through stuff that ideally we would block,
18
+		 * but this is no worse than sending the same to the terminal
19
+		 * without tmux.
20
+		 */
21
+		if (width < 0)
22
+			return (1);
23
+#endif
24
+
25
 		return (-1);
26
+	}
27
 	return (width);
28
 }
29
 

Return to bug 211499