summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive/TLWinGoo.pm
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2009-03-10 12:02:08 +0000
committerNorbert Preining <preining@logic.at>2009-03-10 12:02:08 +0000
commit704973ed15eaaa4fab4987be0edacb603a4a63db (patch)
treebde6a7b4fb959af7a2f4b495b934b655e5e62f8b /Master/tlpkg/TeXLive/TLWinGoo.pm
parent7fc33b72fe3b9065b869fc12d83c1be6409f9f1a (diff)
more fixes for TLWinGoo.pm from Tomek
git-svn-id: svn://tug.org/texlive/trunk@12357 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive/TLWinGoo.pm')
-rw-r--r--Master/tlpkg/TeXLive/TLWinGoo.pm19
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;