setlocale(3) has been fixed to match POSIX standard:

LC_ALL takes precedence over other LC_* envariables.
This commit is contained in:
ru 2001-03-02 16:52:14 +00:00
parent a79ec4865f
commit 3e8d7346e8
22 changed files with 30 additions and 42 deletions

View File

@ -103,7 +103,7 @@ ${TGTS}: upgrade_checks
# Set a reasonable default
.MAIN: all
STARTTIME!= LC_TIME=C date
STARTTIME!= LC_ALL=C date
#
# world
#
@ -132,7 +132,7 @@ world: upgrade_checks
.endif
@echo
@echo "--------------------------------------------------------------"
@printf ">>> ${OBJFORMAT} make world completed on `LC_TIME=C date`\n (started ${STARTTIME})\n"
@printf ">>> ${OBJFORMAT} make world completed on `LC_ALL=C date`\n (started ${STARTTIME})\n"
@echo "--------------------------------------------------------------"
#

View File

@ -408,7 +408,7 @@ buildkernel:
@echo
.for _kernel in ${BUILDKERNELS}
@echo "--------------------------------------------------------------"
@echo ">>> Kernel build for ${_kernel} started on `LC_TIME=C date`"
@echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
@echo "--------------------------------------------------------------"
@echo "===> ${_kernel}"
mkdir -p ${KRNLOBJDIR}
@ -431,7 +431,7 @@ buildkernel:
cd ${KRNLOBJDIR}/${_kernel}; \
${KMAKEENV} MACHINE=${MACHINE} ${MAKE} KERNEL=${INSTKERNNAME} all
@echo "--------------------------------------------------------------"
@echo ">>> Kernel build for ${_kernel} completed on `LC_TIME=C date`"
@echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
@echo "--------------------------------------------------------------"
.endfor

View File

@ -4,7 +4,7 @@
# $FreeBSD$
# Default device.
locale=${LC_CTYPE:-$LANG}
locale=${LC_ALL:-${LC_CTYPE:-$LANG}}
if test `expr "$locale" : ".*\.ISO_8859-1"` -gt 0
then
T=latin1

View File

@ -7,7 +7,7 @@
# Don't want foreign dates.
LANGUAGE=
LC_TIME=C; export LC_TIME
LC_ALL=C; export LC_ALL
(date;

View File

@ -4,7 +4,7 @@
# $FreeBSD$
# Default device.
locale=${LC_CTYPE:-$LANG}
locale=${LC_ALL:-${LC_CTYPE:-$LANG}}
if test `expr "$locale" : ".*\.ISO_8859-1"` -gt 0
then
T=latin1

View File

@ -54,7 +54,7 @@ then
else
host=`uname -n`
fi
echo '#####' built by $user@$host on `LC_TIME=C date`
echo '#####' built by $user@$host on `LC_ALL=C LC_TIME=C date`
echo '#####' in `pwd` | sed 's/\/tmp_mnt//'
echo '#####' using $1 as configuration include directory | sed 's/\/tmp_mnt//'
echo "define(\`__HOST__', $host)dnl"

View File

@ -36,7 +36,7 @@ case "$weekly_whatis_enable" in
then
for i in ${man_locales}
do
LC_CTYPE=$i /usr/libexec/makewhatis.local -a \
LC_ALL=$i /usr/libexec/makewhatis.local -a \
-L "${MANPATH}" || rc=3
done
fi

View File

@ -42,7 +42,7 @@ case "$weekly_catman_enable" in
then
for i in $man_locales
do
LC_CTYPE=$i echo /usr/libexec/catman.local -L \
LC_ALL=$i echo /usr/libexec/catman.local -L \
"$MANPATH" | su -fm man || rc=3
done
fi

View File

@ -138,8 +138,8 @@ speaker device file
.El
.Sh ENVIRONMENT
.Bl -tag -width LC_CTYPE -compact
.It Ev LC_CTYPE
.It Ev LC_ALL
.It Ev LC_CTYPE
.It Ev LANG
If one of these variables (in this priority) is set to a locale ending in
.Ql KOI8-R ,

View File

@ -318,9 +318,9 @@ main(int argc, char **argv)
argc -= optind;
argv += optind;
if((p = getenv("LC_CTYPE")) ||
(p = getenv("LC_ALL")) ||
(p = getenv("LANG"))) {
if(((p = getenv("LC_ALL")) && *p) ||
((p = getenv("LC_CTYPE")) && *p) ||
((p = getenv("LANG")) && *p)) {
if(strlen(p) >= sizeof(".KOI8-R") &&
strcasecmp(&p[strlen(p) + 1 - sizeof(".KOI8-R")], ".KOI8-R") == 0)
hightab = koi8rtab;

View File

@ -46,14 +46,8 @@ sub variables {
$remove = 0; # unlink forgotten man/catpages
$locale = 0; # go through localized man directories only
# choose localized man directories suffix. If $LC_CTYPE is set, then
# its value should be used as suffix, otherwise $LANG (if set)
$local_suffix = "";
if ($ENV{'LC_CTYPE'}) {
$local_suffix = $ENV{'LC_CTYPE'}
} elsif ($ENV{'LANG'}) {
$local_suffix = $ENV{'LANG'}
}
# choose localized man directories suffix.
$local_suffix = $ENV{'LC_ALL'} || $ENV{'LC_CTYPE'} || $ENV{'LANG'};
# if no argument for directories given
@defaultmanpath = ( '/usr/share/man' );

View File

@ -433,14 +433,8 @@ sub variables {
$append = 0; # Don't delete old entries
$locale = 0; # Build DB only for localized man directories
# choose localized man direcotries suffixs. If $LC_CTYPE is set, then
# its value will be used as suffix, otherwise $LANG value (if set)
$local_suffix = "";
if ($ENV{'LC_CTYPE'}) {
$local_suffix = $ENV{'LC_CTYPE'};
} elsif ($ENV{'LANG'}) {
$local_suffix = $ENV{'LANG'}
}
# choose localized man directories suffix.
$local_suffix = $ENV{'LC_ALL'} || $ENV{'LC_CTYPE'} || $ENV{'LANG'};
# if no argument for directories given
@defaultmanpath = ( '/usr/share/man' );

View File

@ -112,7 +112,7 @@ component.
.Pp
Locale name is taken from the first of three environment variables
with a nonempty value:
.Ev LC_CTYPE , LC_ALL ,
.Ev LC_ALL , LC_CTYPE ,
or
.Ev LANG ,
in the specified order.
@ -179,7 +179,7 @@ the files that would be formatted or displayed.
.El
.Sh ENVIRONMENT
.Bl -tag -width MANROFFSEQ
.It Ev LC_CTYPE , LC_ALL , LANG
.It Ev LC_ALL , LC_CTYPE , LANG
These variables specify the preferred language for manual pages.
(See the
.Fl o

View File

@ -28,7 +28,7 @@
PATH=/bin:/usr/bin:$PATH
export PATH
DATE=`LC_TIME=C date` || exit
DATE=`LC_ALL=C date` || exit
# Check whether we have an RCS subdirectory, so we can have the right
# prefix for our paths.
if test -d RCS

View File

@ -204,7 +204,7 @@ rerelease release:
-rm -rf ${CHROOTDIR}
.endif
mkdir -p ${CHROOTDIR}
@echo ">>> make release started on `LC_TIME=C TZ=GMT date`"
@echo ">>> make release started on `LC_ALL=C TZ=GMT date`"
cd ${.CURDIR}/../etc && ${MAKE} distrib-dirs DESTDIR=${CHROOTDIR}
cd ${.CURDIR}/../etc && ${MAKE} distribution DESTDIR=${CHROOTDIR}
if [ -f /etc/resolv.conf ]; then \
@ -320,7 +320,7 @@ rerelease release:
echo "fi" >> ${CHROOTDIR}/mk
echo "cd /usr/src/release" >> ${CHROOTDIR}/mk
echo "make \$${_RELTARGET}" >> ${CHROOTDIR}/mk
echo "echo \">>> make ${.TARGET} finished on \`LC_TIME=C TZ=GMT date\`\"" >> ${CHROOTDIR}/mk
echo "echo \">>> make ${.TARGET} finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${CHROOTDIR}/mk
chmod 755 ${CHROOTDIR}/mk
chroot ${CHROOTDIR} /mk

View File

@ -45,7 +45,7 @@ buildinf.h:
echo " /* auto-generated by crypto/Makefile.ssl for crypto/cversion.c */"; \
echo " #define CFLAGS \"$(CC)\""; \
echo " #define PLATFORM \"`uname -s`-`uname -m`\""; \
echo " #define DATE \"`LC_TIME=C date`\""; \
echo " #define DATE \"`LC_ALL=C date`\""; \
echo "#endif" ) > ${.TARGET}
# XXX: The openssl/ dependencies are not correct, in that a change in

View File

@ -36,7 +36,7 @@
#
# @(#)newvers.sh 8.1 (Berkeley) 4/20/94
LC_TIME=C; export LC_TIME
LC_ALL=C; export LC_ALL
u=${USER-root} h=`hostname` t=`date`
#r=`head -n 6 $1 | tail -n 1 | awk -F: ' { print $1 } '`
r=`awk -F: ' /^[0-9]\.[0-9]+:/ { print $1; exit }' $1`

View File

@ -38,6 +38,6 @@ CFLAGS+= -I${.CURDIR} -I${.CURDIR}/${MACHINE_ARCH} -I${.CURDIR}/../common -DFICL
softcore.c: ${SOFTWORDS} softcore.awk
(cd ${.CURDIR}/softwords; cat ${SOFTWORDS} \
| awk -f softcore.awk -v datestamp="`LC_TIME=C date`") > ${.TARGET}
| awk -f softcore.awk -v datestamp="`LC_ALL=C date`") > ${.TARGET}

View File

@ -78,7 +78,7 @@ fi
COPYRIGHT="$COPYRIGHT
"
LC_TIME=C; export LC_TIME
LC_ALL=C; export LC_ALL
if [ ! -r version ]
then
echo 0 > version

View File

@ -39,7 +39,7 @@ if ($x11) {
sub variables_static {
$lang_default = "en"; # set default language
$lang = $ENV{'LC_CTYPE'} || $ENV{'LANG'} || $lang_default;
$lang = $ENV{'LC_ALL'} || $ENV{'LC_CTYPE'} || $ENV{'LANG'} || $lang_default;
$lang = &lang($lang);
$program = $0; $program =~ s|.*/||; $program =~ s/\.(pl|perl)$//;
$keymapdir = "/usr/share/syscons/keymaps";

View File

@ -39,7 +39,7 @@ CLEANFILES+= tmp_version.c pathnames.h
CFLAGS+= -I.
tmp_version.c: version.c ${BIND_DIR}/Version
(u=$${USER-root} d=`pwd` h=`hostname` t=`LC_TIME=C date`; \
(u=$${USER-root} d=`pwd` h=`hostname` t=`LC_ALL=C date`; \
sed -e "s|%WHEN%|$${t}|" -e "s|%VERSION%|"${VER}"|" \
-e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
< ${BIND_DIR}/bin/named/version.c > tmp_version.c)

View File

@ -9,7 +9,7 @@ case "" in
*) ConfStr="$ConfStr RSAREF" ;;
esac
ConfStr="$ConfStr 4.0.99b `LC_TIME=C date`"
ConfStr="$ConfStr 4.0.99b `LC_ALL=C date`"
if [ ! -f .version ]; then
echo 0 > .version