Date: Sat, 19 Jan 2013 20:27:27 GMT From: Norikatsu Shigemura <nork@FreeBSD.org> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/175440: [PATCH] Fix ports/japanese/less's behavior with LANG=ja_JP.UTF-8 Message-ID: <201301192027.r0JKRRtl035556@red.freebsd.org> Resent-Message-ID: <201301192030.r0JKU0ZI095414@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301192027.r0JKRRtl035556>