From owner-freebsd-ports Mon Feb 4 4:30:20 2002 Delivered-To: freebsd-ports@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 9CAC137B422 for ; Mon, 4 Feb 2002 04:30:03 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g14CU3C97737; Mon, 4 Feb 2002 04:30:03 -0800 (PST) (envelope-from gnats) Received: from mhsin.org (mhsin.m7.ntu.edu.tw [140.112.249.69]) by hub.freebsd.org (Postfix) with ESMTP id 3F15E37B417 for ; Mon, 4 Feb 2002 04:26:42 -0800 (PST) Received: (from mhsin@localhost) by mhsin.org (8.11.3/8.11.3) id g14CQb066081; Mon, 4 Feb 2002 20:26:37 +0800 (CST) (envelope-from mhsin) Message-Id: <200202041226.g14CQb066081@mhsin.org> Date: Mon, 4 Feb 2002 20:26:37 +0800 (CST) From: mhsin@mhsin.org Reply-To: mhsin@mhsin.org To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: ports/34610: chinese/mutt causes some strange line wrapping with Big5 string. Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 34610 >Category: ports >Synopsis: chinese/mutt causes some strange line wrapping with Big5 string. >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Feb 04 04:30:03 PST 2002 >Closed-Date: >Last-Modified: >Originator: Michael Hsin >Release: FreeBSD 4.3-RELEASE i386 >Organization: >Environment: System: FreeBSD mhsin.org 4.3-RELEASE FreeBSD 4.3-RELEASE #1: Sat Jun 9 19:54:25 CST 2001 root@mhsin.org:/usr/src/sys/compile/mhsin i386 >Description: chinese/mutt's builtin pager decides wrapping position according to space only, but we used to split a long line at spaces AND next to Big5 characters. >How-To-Repeat: Send a message (to yourself) with a line like this: B5 B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5 ^ right margin mutt's pager will display: B5 +B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5 But we like this more: B5 B5B5B5B5B5B5B5B5B5B5B5B5B5B5 +B5B5 >Fix: --- mutt-1.3.27/pager.c.orig Mon Feb 4 19:13:03 2002 +++ mutt-1.3.27/pager.c Mon Feb 4 19:14:33 2002 @@ -1028,7 +1028,7 @@ { int space = -1; /* index of the last space or TAB */ int col = option (OPTMARKERS) ? (*lineInfo)[n].continuation : 0; - int ch, vch, k, last_special = -1, special = 0, t; + int ch, vch, k, last_special = -1, special = 0, t = 0, old_t = 0; wchar_t wc; mbstate_t mbstate; @@ -1123,7 +1123,10 @@ { if (wc == ' ') space = ch; + old_t = t; t = wcwidth (wc); + if(t > 1 || old_t > 1) + space = ch; if (col + t > wrap_cols) break; col += t; @@ -1340,6 +1343,7 @@ { buf_ptr = buf + ch; /* skip trailing blanks */ + ch --; while (ch && (buf[ch] == ' ' || buf[ch] == '\t' || buf[ch] == '\r')) ch--; cnt = ch + 1; >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message