From owner-cvs-src-old@FreeBSD.ORG Wed May 5 21:53:21 2010 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 918C61065670 for ; Wed, 5 May 2010 21:53:21 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 7EFED8FC13 for ; Wed, 5 May 2010 21:53:21 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id o45LrLQ0084878 for ; Wed, 5 May 2010 21:53:21 GMT (envelope-from jilles@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o45LrLKq084877 for cvs-src-old@freebsd.org; Wed, 5 May 2010 21:53:21 GMT (envelope-from jilles@repoman.freebsd.org) Message-Id: <201005052153.o45LrLKq084877@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to jilles@repoman.freebsd.org using -f From: Jilles Tjoelker Date: Wed, 5 May 2010 21:48:40 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/bin/sh eval.c var.c var.h src/tools/regression/bin/sh/builtins locale1.0 X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 May 2010 21:53:21 -0000 jilles 2010-05-05 21:48:40 UTC FreeBSD src repository Modified files: bin/sh eval.c var.c var.h Added files: tools/regression/bin/sh/builtins locale1.0 Log: SVN rev 207678 on 2010-05-05 21:48:40Z by jilles sh: Apply locale vars on builtins, recognize LC_MESSAGES as a locale var. This allows doing things like LC_ALL=C some_builtin to run a builtin under a different locale, just like is possible with external programs. The immediate reason is that this allows making printf(1) a builtin without breaking things like LC_NUMERIC=C printf '%f\n' 1.2 This change also affects special builtins, as even though the assignment is persistent, the export is only to the builtin (unless the variable was already exported). Note: for this to work for builtins that also exist as external programs such as /bin/test, the setlocale() call must be under #ifndef SHELL. The shell will do the setlocale() calls which may not agree with the environment variables. Revision Changes Path 1.81 +4 -0 src/bin/sh/eval.c 1.46 +68 -7 src/bin/sh/var.c 1.17 +2 -0 src/bin/sh/var.h 1.1 +133 -0 src/tools/regression/bin/sh/builtins/locale1.0 (new)