fix environment handling for perl 5.003_02

gotta love 1997’s software
This commit is contained in:
tg 2008-03-23 20:54:29 +00:00
parent bfe7bff954
commit d18e58e74d
2 changed files with 13 additions and 11 deletions

View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.pl,v 1.14 2008/02/29 12:48:09 tg Exp $
# $MirOS: src/bin/mksh/check.pl,v 1.15 2008/03/23 20:54:29 tg Exp $
# $OpenBSD: th,v 1.12 2005/05/28 04:53:47 millert Exp $
#-
# Example test:
@ -245,13 +245,6 @@ if (defined $opt_e) {
}
%old_env = %ENV;
# The following doesn't work with perl5... Need to do it explicitly - yuck.
#%ENV = %new_env;
foreach $k (keys(%ENV)) {
delete $ENV{$k};
}
$ENV{$k} = $v while ($k,$v) = each %new_env;
die "$prog: couldn't make directory $tempdir - $!\n" if !mkdir($tempdir, 0777);
chop($pwd = `pwd 2>/dev/null`);
@ -467,9 +460,9 @@ run_test
$i = index($var, '=');
next if $i == 0 || $var eq '';
if ($i < 0) {
delete $ENV{$var};
delete $new_env{$var};
} else {
$ENV{substr($var, 0, $i)} = substr($var, $i + 1);
$new_env{substr($var, 0, $i)} = substr($var, $i + 1);
}
}
}
@ -499,6 +492,14 @@ run_test
substr($test{'arguments'}, 1)));
}
push(@argv, $temps) if defined $test{'script'};
# The following doesn't work with perl5... Need to do it explicitly - yuck.
#%ENV = %new_env;
foreach $k (keys(%ENV)) {
delete $ENV{$k};
}
$ENV{$k} = $v while ($k,$v) = each %new_env;
exec { $argv[0] } @argv;
print STDERR "$prog: couldn't execute $test_prog - $!\n";
kill('TERM', $$);

View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.159 2008/03/23 20:43:51 tg Exp $
# $MirOS: src/bin/mksh/check.t,v 1.160 2008/03/23 20:54:29 tg Exp $
# $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $
@ -4237,6 +4237,7 @@ description:
XXX if the OS can already execute them, we lose
note: cygwin execve(2) doesn't return to us with ENOEXEC, we lose
note: perl 5.004_04 on Linux 2.0 doesn't support Unicode, t4 fails
note: same for perl 5.003_02 on BSD/OS 3.1 and possibly others
category: pdksh,!os:cygwin,!os:uwin-nt
env-setup: !FOO=BAR!
stdin: