summaryrefslogtreecommitdiff
path: root/Master/tlpkg
diff options
context:
space:
mode:
authorPiotr Strzelczyk <piotr@eps.gda.pl>2009-03-12 23:19:53 +0000
committerPiotr Strzelczyk <piotr@eps.gda.pl>2009-03-12 23:19:53 +0000
commit00e711b27174288f7215946a760bfd15badd9950 (patch)
tree8620f0c2304f075b852a9bff239ffab405b32283 /Master/tlpkg
parent45d4e495492214d0ff89696cfd2161ca68dce631 (diff)
fix for locale on Vista and simpler expand_string
git-svn-id: svn://tug.org/texlive/trunk@12372 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg')
-rw-r--r--Master/tlpkg/TeXLive/TLWinGoo.pm8
1 files changed, 3 insertions, 5 deletions
diff --git a/Master/tlpkg/TeXLive/TLWinGoo.pm b/Master/tlpkg/TeXLive/TLWinGoo.pm
index 0057bde14fb..fbc163dd39e 100644
--- a/Master/tlpkg/TeXLive/TLWinGoo.pm
+++ b/Master/tlpkg/TeXLive/TLWinGoo.pm
@@ -235,6 +235,8 @@ Two-letter country code representing the locale of the current user
sub reg_country {
my $value = $Registry -> {"CUser/Control Panel/International//Locale"};
return 0 unless $value;
+ # there might be trailing nulls on Vista
+ chop($value) while ($value =~ /\0$/);
$value = substr $value, -4;
return 0 unless $value;
my $lmkey = $Registry -> Open("HKEY_CLASSES_ROOT/MIME/Database/Rfc1766/",
@@ -288,12 +290,8 @@ values as environment variable and returns the result.
sub expand_string {
my ($s) = @_;
- $s =~ s/%([^%;]+)%/expand_var($1)/eg;
+ $s =~ s/%([^%;]+)%/$ENV{$1} ? $ENV{$1} : "%$1%"/eg;
return $s;
- sub expand_var {
- my ($key) = @_;
- return ($ENV{$key} ? $ENV{$key} : "%$key%");
- }
}
=pod