summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
Diffstat (limited to 'Master')
-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