summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2014-01-29 09:51:38 -0700
committerKarl Williamson <public@khwilliamson.com>2014-01-29 10:23:14 -0700
commit8b76dc1d20b9a57382173ce08c4ad10cf5acb5ef (patch)
treef1653f91dbcc78f446741b0dfe85404e6ed45b0f
parent667eac0cd75b24849e65753cb51d9a6b8111c052 (diff)
downloadperl-8b76dc1d20b9a57382173ce08c4ad10cf5acb5ef.tar.gz
t/loc_tools.pl: find_locales() Don't destroy callers ENV
This code was recently moved from lib/locale.t to a new file essentially unchanged, so that it could be common code. It deletes several environment variables, such as PATH, to avoid interference with going out and looking at the locales. In lib/locale.t, those environment variables are not needed again, but that isn't true of all the callers. The solution is simply to localize the removal. This should fix [perl #121106], but there remain test failures there.
-rw-r--r--t/loc_tools.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/t/loc_tools.pl b/t/loc_tools.pl
index 890f8e148e..31d599ea29 100644
--- a/t/loc_tools.pl
+++ b/t/loc_tools.pl
@@ -95,10 +95,10 @@ sub find_locales { # Returns an array of all the locales we found on the
# program without the taint mode getting grumpy.
# $ENV{PATH} is special in VMS.
- delete $ENV{PATH} if $^O ne 'VMS' or $Config{d_setenv};
+ delete local $ENV{PATH} if $^O ne 'VMS' or $Config{d_setenv};
# Other subversive stuff.
- delete @ENV{qw(IFS CDPATH ENV BASH_ENV)};
+ delete local @ENV{qw(IFS CDPATH ENV BASH_ENV)};
if (-x "/usr/bin/locale"
&& open(LOCALES, "/usr/bin/locale -a 2>/dev/null|"))