From owner-svn-src-all@freebsd.org Wed Aug 24 16:44:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9FA5BC397D; Wed, 24 Aug 2016 16:44:28 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A2551E25; Wed, 24 Aug 2016 16:44:28 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7OGiRNP017367; Wed, 24 Aug 2016 16:44:27 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7OGiR4r017366; Wed, 24 Aug 2016 16:44:27 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201608241644.u7OGiR4r017366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Wed, 24 Aug 2016 16:44:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304755 - head/lib/libc/nls X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 16:44:28 -0000 Author: ache Date: Wed Aug 24 16:44:27 2016 New Revision: 304755 URL: https://svnweb.freebsd.org/changeset/base/304755 Log: Use current locale (f.e. set by thread). It was global locale always previously. MFC after: 7 days Modified: head/lib/libc/nls/msgcat.c Modified: head/lib/libc/nls/msgcat.c ============================================================================== --- head/lib/libc/nls/msgcat.c Wed Aug 24 16:40:29 2016 (r304754) +++ head/lib/libc/nls/msgcat.c Wed Aug 24 16:44:27 2016 (r304755) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -56,7 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include "un-namespace.h" -#include "../locale/setlocale.h" /* for ENCODING_LEN */ +#include "../locale/xlocale_private.h" #define _DEFAULT_NLS_PATH "/usr/share/nls/%L/%N.cat:/usr/share/nls/%N/%L:/usr/local/share/nls/%L/%N.cat:/usr/local/share/nls/%N/%L" @@ -115,9 +114,10 @@ catopen(const char *name, int type) { struct stat sbuf; struct catentry *np; - char *base, *cptr, *cptr1, *lang, *nlspath, *pathP, *pcode; - char *plang, *pter, *tmpptr; + char *base, *cptr, *cptr1, *nlspath, *pathP, *pcode; + char *plang, *pter; int saverr, spcleft; + const char *lang, *tmpptr; char path[PATH_MAX]; /* sanity checking */ @@ -129,7 +129,7 @@ catopen(const char *name, int type) lang = NULL; else { if (type == NL_CAT_LOCALE) - lang = setlocale(LC_MESSAGES, NULL); + lang = querylocale(LC_MESSAGES_MASK, __get_locale()); else lang = getenv("LANG");