diff options
Diffstat (limited to 'Master')
-rw-r--r-- | Master/tlpkg/TeXLive/TLWinGoo.pm | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/Master/tlpkg/TeXLive/TLWinGoo.pm b/Master/tlpkg/TeXLive/TLWinGoo.pm index b1cfe76d1ea..0057bde14fb 100644 --- a/Master/tlpkg/TeXLive/TLWinGoo.pm +++ b/Master/tlpkg/TeXLive/TLWinGoo.pm @@ -286,19 +286,14 @@ values as environment variable and returns the result. =cut -sub expand_env { - my $key = shift; - foreach my $k (keys %ENV) { - return $ENV{$k} if (uc($k) eq uc($key)); - } - - return "%$key%"; -} - sub expand_string { - $s = shift @_; - $s =~ s/%([^%;]+)%/expand_env($1)/eg; + my ($s) = @_; + $s =~ s/%([^%;]+)%/expand_var($1)/eg; return $s; + sub expand_var { + my ($key) = @_; + return ($ENV{$key} ? $ENV{$key} : "%$key%"); + } } =pod @@ -324,7 +319,7 @@ sub is_a_texdir { $d =~ s/\\/\//g; $d = $d . '/' unless $d =~ m!/$!; # don't consider anything under %systemroot% a texdir - my $sr = uc(expand_string($ENV{'SystemRoot'})); + my $sr = uc($ENV{'SystemRoot'}); $sr =~ s/\\/\//g; $sr = $sr . '/' unless $sr =~ m!/$!; return 0 if index($d, $sr)==0; |