diff options
author | Norbert Preining <norbert@preining.info> | 2022-05-24 08:25:08 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-06-06 08:18:56 +0900 |
commit | 4f2710ca193f06720b768ea2e46b5f1611c39cfb (patch) | |
tree | c2f41fd42c7b238df829d4c5ee168208b27c6725 /Master/tlpkg/installer | |
parent | ec738ee7ddadcc3854de750b368d2bbe6c400d8f (diff) |
Unify homedir and tilde expansion
Diffstat (limited to 'Master/tlpkg/installer')
-rw-r--r-- | Master/tlpkg/installer/install-menu-text.pl | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/Master/tlpkg/installer/install-menu-text.pl b/Master/tlpkg/installer/install-menu-text.pl index a47eb11e467..f91cfd6f4cd 100644 --- a/Master/tlpkg/installer/install-menu-text.pl +++ b/Master/tlpkg/installer/install-menu-text.pl @@ -623,10 +623,7 @@ sub input_dirname $answer =~ s!\\!/!g if win32(); # switch to forward slashes if (!$noexpansion) { - my $home = getenv('HOME'); - $home = getenv('USERPROFILE') if win32(); - $home ||= '~'; - $answer =~ s/^~/$home/; # $home expansion + $answer = $TeXLive::TLUtils::expand_tilde($answer); } if ($answer !~ m/^~/) { @@ -844,9 +841,7 @@ EOF if (unix()) { if (("\u$answer" eq 'L') and !$vars{'instopt_portable'}) { - my $home = getenv('HOME'); - $home = getenv('USERPROFILE') if (win32()); - $home ||= '~'; + my $home = TeXLive::TLUtils::get_user_home(); toggle 'instopt_adjustpath'; if ($vars{'instopt_adjustpath'}) { print "New value for binary directory [$sys_bin]: "; @@ -874,9 +869,7 @@ EOF } } else { if (("\u$answer" eq 'L') and !$vars{'instopt_portable'}) { - my $home = getenv('HOME'); - $home = getenv('USERPROFILE') if (win32()); - $home ||= '~'; + my $home = TeXLive::TLUtils::get_user_home; toggle 'instopt_adjustpath'; return $command{'self'}; } |