Date: Wed, 5 May 2010 21:48:40 +0000 (UTC) From: Jilles Tjoelker <jilles@FreeBSD.org> To: cvs-src-old@freebsd.org Subject: cvs commit: src/bin/sh eval.c var.c var.h src/tools/regression/bin/sh/builtins locale1.0 Message-ID: <201005052153.o45LrLKq084877@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201005052153.o45LrLKq084877>
