1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-12-28 16:15:02 +01:00

Martin Vaeth: 31988 (plus missing semicolon): remove LC_CTYPE heuristics, assure clean environment, force LANG=C

This commit is contained in:
Barton E. Schaefer 2013-11-15 21:48:45 -08:00
parent 42fabadc35
commit e7fa65ffae
3 changed files with 7 additions and 34 deletions

View file

@ -1,3 +1,8 @@
2013-11-15 Barton E. Schaefer <schaefer@zsh.org>
* Martin Vaeth: 31988: Doc/Makefile.in, Util/helpfiles: remove
LC_CTYPE heuristics, assure clean environment, force LANG=C
2013-11-14 Peter Stephenson <p.stephenson@samsung.com>
* Jun T.: 31984: Completion/Unix/Command/_df: new completion.

View file

@ -188,7 +188,7 @@ man: $(MAN)
runhelp: man
test x"$(runhelpdir)" = x"" || { \
test -r $(sdir)/help.txt && test -r $(sdir)/help/zmodload; \
} || perl $(sdir_top)/Util/helpfiles $(lc_ctype) -- \
} || perl $(sdir_top)/Util/helpfiles \
$(sdir)/zshbuiltins.1 $(sdir)/help $(sdir)/help.txt \
|| { rm -f $(sdir)/help.txt $(sdir)/help/zmodload; false; }
.PHONY: runhelp

View file

@ -52,38 +52,6 @@ sub Die {
exit(1);
}
&Usage() unless(@ARGV);
delete($ENV{'LC_ALL'});
$ENV{'LANG'} = 'C';
if($ARGV[0] =~ /-f(.*)/) {
$lc_ctype = $1;
shift(@ARGV);
&Usage() unless(@ARGV);
if($lc_ctype eq '') {
$lc_ctype = shift(@ARGV);
&Usage() unless(@ARGV);
}
} else {
open(LOCALE, '-|', 'locale', '-a') || &Die('cannot execute locale -a');
$lc_ctype = '';
$choice = 0;
while(<LOCALE>) {
if(/en.*utf-?8/i) {
$lc_ctype = $_;
last;
} elsif(/utf-?8/i) {
$lc_ctype = $_;
$choice = 2;
} elsif(($choice < 1) && (/(en)|\./i)) {
$lc_ctype = $_;
$choice = 1;
}
}
close(LOCALE);
}
&Info("using LC_CTYPE=$lc_ctype");
$ENV{'LC_CTYPE'} = $lc_ctype unless($lc_ctype eq '');
shift(@ARGV) if($ARGV[0] eq '--');
&Usage() unless(@ARGV);
$manfile = shift(@ARGV);
&Usage() unless(@ARGV);
@ -231,7 +199,7 @@ BUILTINS: while (<MANPAGE>) {
select STDOUT;
close OUT;
close MANPAGE;
close(MANPAGE) || &Die('piping from man ', $manfile, ' failed');
foreach $file (<*>) {
open (IN, $file);