From owner-freebsd-ports-bugs@FreeBSD.ORG Sat Jan 19 20:30:00 2013 Return-Path: Delivered-To: freebsd-ports-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7DBD3E87 for ; Sat, 19 Jan 2013 20:30:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 643F0F21 for ; Sat, 19 Jan 2013 20:30:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.6/8.14.6) with ESMTP id r0JKU0mq095415 for ; Sat, 19 Jan 2013 20:30:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.6/8.14.6/Submit) id r0JKU0ZI095414; Sat, 19 Jan 2013 20:30:00 GMT (envelope-from gnats) Resent-Date: Sat, 19 Jan 2013 20:30:00 GMT Resent-Message-Id: <201301192030.r0JKU0ZI095414@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Norikatsu Shigemura Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0813CE50 for ; Sat, 19 Jan 2013 20:27:28 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id ECCFCF18 for ; Sat, 19 Jan 2013 20:27:27 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r0JKRRrJ035557 for ; Sat, 19 Jan 2013 20:27:27 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.5/8.14.5/Submit) id r0JKRRtl035556; Sat, 19 Jan 2013 20:27:27 GMT (envelope-from nobody) Message-Id: <201301192027.r0JKRRtl035556@red.freebsd.org> Date: Sat, 19 Jan 2013 20:27:27 GMT From: Norikatsu Shigemura To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: ports/175440: [PATCH] Fix ports/japanese/less's behavior with LANG=ja_JP.UTF-8 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jan 2013 20:30:00 -0000 >Number: 175440 >Category: ports >Synopsis: [PATCH] Fix ports/japanese/less's behavior with LANG=ja_JP.UTF-8 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Jan 19 20:30:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Norikatsu Shigemura >Release: FreeBSD/amd64 9.1-R >Organization: >Environment: FreeBSD www1067gj.sakura.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r245383: Mon Jan 14 08:33:18 JST 2013 nork@www1067gj.sakura.ne.jp:/usr/obj/usr/src/sys/NYARLATHOTEP amd64 >Description: In case of not defined JLESSCHARSET enviroment value, jless looks LANG enviroment value, and make a decision on JLESSCHARSET from LANG. If LANG has UTF-8/UTF8 keyword, so jless assumes JLESSCHARSET=utf8. But we hope to assume JLESSCHARSET=japanese-utf8 if LANG=ja_JP.UTF-8. >How-To-Repeat: On UTF-8 console: OK$ env LANG=ja_JP.UTF-8 JLESSCHARSET=japanese-utf8 jless eucjp-file utf8-file NG$ env LANG=ja_JP.UTF-8 JLESSCHARSET=utf8 jless eucjp-file utf8-file NG$ env LANG=ja_JP.UTF-8 jless eucjp-file utf8-file >Fix: To fix decision order, please apply attached my patch. Patch attached with submission follows: Index: Makefile =================================================================== --- Makefile (revision 310655) +++ Makefile (working copy) @@ -3,7 +3,7 @@ PORTNAME= less+iso PORTVERSION= 382.262 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= japanese MASTER_SITES= ${MASTER_SITE_LOCAL} MASTER_SITE_SUBDIR= nork @@ -33,7 +33,7 @@ MAN1= jless.1 jlesskey.1 DOCSDIR= ${PREFIX}/share/doc/less PORTDOCS= README.iso README.iso.jp README.lesw.euc \ - README.regex README.regex.jp + README.regex README.regex.jp README.ext.jp post-extract: cd ${WRKDIR} && \ Index: files/patch-charset.c =================================================================== --- files/patch-charset.c (revision 0) +++ files/patch-charset.c (working copy) @@ -0,0 +1,41 @@ +--- charset.c.orig 2013-01-20 04:32:52.491037000 +0900 ++++ charset.c 2013-01-20 05:05:01.106026675 +0900 +@@ -872,6 +872,18 @@ + return; + } + ++#if HAVE_LOCALE ++ /* ++ * Use setlocale. ++ */ ++ ilocale(); ++#else ++#if MSDOS_COMPILER ++ /* ++ * Default to "dos". ++ */ ++ (void) icharset("dos"); ++#else + #if HAVE_STRSTR + /* + * Check whether LC_ALL, LC_CTYPE or LANG look like UTF-8 is used. +@@ -888,19 +900,6 @@ + return; + } + #endif +- +-#if HAVE_LOCALE +- /* +- * Use setlocale. +- */ +- ilocale(); +-#else +-#if MSDOS_COMPILER +- /* +- * Default to "dos". +- */ +- (void) icharset("dos"); +-#else + /* + * All variables are not defined either, default to DEFCHARSET. + * DEFCHARSET is defined in defines.h. >Release-Note: >Audit-Trail: >Unformatted: