summaryrefslogtreecommitdiff
path: root/Util
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2013-11-15 21:48:45 -0800
committerBarton E. Schaefer <schaefer@zsh.org>2013-11-15 21:48:45 -0800
commite7fa65ffae499441bae9e967083c26e342e0fac7 (patch)
tree69a2644b3a465a7d58cf21b1cb572b0ec2625d45 /Util
parent42fabadc35bbde760c3b4cf01109358a45c5dd54 (diff)
downloadzsh-e7fa65ffae499441bae9e967083c26e342e0fac7.tar.gz
zsh-e7fa65ffae499441bae9e967083c26e342e0fac7.zip
Martin Vaeth: 31988 (plus missing semicolon): remove LC_CTYPE heuristics, assure clean environment, force LANG=C
Diffstat (limited to 'Util')
-rwxr-xr-xUtil/helpfiles34
1 files changed, 1 insertions, 33 deletions
diff --git a/Util/helpfiles b/Util/helpfiles
index 3e3125e14..221f673f6 100755
--- a/Util/helpfiles
+++ b/Util/helpfiles
@@ -53,38 +53,6 @@ sub Die {
}
&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);
$destdir = shift(@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);