diff options
Diffstat (limited to 'Master/tlpkg')
-rwxr-xr-x | Master/tlpkg/installer/install-menu-text.pl | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/Master/tlpkg/installer/install-menu-text.pl b/Master/tlpkg/installer/install-menu-text.pl index 7a3823831ba..b43077c3e65 100755 --- a/Master/tlpkg/installer/install-menu-text.pl +++ b/Master/tlpkg/installer/install-menu-text.pl @@ -530,7 +530,7 @@ EOF } elsif ("\u$answer" eq '5') { print "New value for TEXMFHOME [$vars{'TEXMFHOME'}]: "; - $answer = &input_dirname (); + $answer = &input_dirname (1); $vars{'TEXMFHOME'} = $answer if $answer ne ""; return $command{'self'}; } @@ -548,20 +548,25 @@ EOF # sub input_dirname { + my $noexpansion = shift; chomp (my $answer = <STDIN>); return "" if $answer eq ""; $answer =~ s!\\!/!g if win32(); # switch to forward slashes - my $home = getenv('HOME'); - $home = getenv('USERPROFILE') if win32(); - $home ||= '~'; - $answer =~ s/^~/$home/; # $home expansion + if (!$noexpansion) { + my $home = getenv('HOME'); + $home = getenv('USERPROFILE') if win32(); + $home ||= '~'; + $answer =~ s/^~/$home/; # $home expansion + } - # relative paths are unlikely to work in texmf.cnf, et al., - # and don't have any apparent practical use. Convert to absolute. - if (! File::Spec->file_name_is_absolute($answer)) { - $answer = Cwd::abs_path($answer); + if ($answer !~ m/^~/) { + # relative paths are unlikely to work in texmf.cnf, et al., + # and don't have any apparent practical use. Convert to absolute. + if (! File::Spec->file_name_is_absolute($answer)) { + $answer = Cwd::abs_path($answer); + } } return $answer; } |