diff options
-rw-r--r-- | Master/tlpkg/installer/install-menu-perltk.pl | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/Master/tlpkg/installer/install-menu-perltk.pl b/Master/tlpkg/installer/install-menu-perltk.pl index 6ac0f7f5349..008190880fc 100644 --- a/Master/tlpkg/installer/install-menu-perltk.pl +++ b/Master/tlpkg/installer/install-menu-perltk.pl @@ -90,6 +90,19 @@ $::run_menu = \&run_menu_perltk; # ################################################################## +sub native_slashify { + my ($r) = @_; + $r =~ s/\//\\/g if win32(); + return $r; +} + +sub forward_slashify { + my ($r) = @_; + $r =~ s/\\/\//g if win32(); + return $r; +} + + sub setup_hooks_perltk { @::info_hook = (); push @::info_hook, @@ -468,11 +481,11 @@ sub menu_edit_vars_value { $hint_var = win32() ? '%USERPROFILE%' : '$HOME'; } $sw->Label(-text => __("Enter path for %s (use ~ for %s)", $key, $hint_var))->pack(-padx => "2m", -pady => "2m"); - my $entry = $sw->Entry(-textvariable => $val, -width => 60); + my $entry = $sw->Entry(-textvariable => native_slashify($val), -width => 60); $entry->pack(-padx => "2m", -pady => "2m")->focus(); my $f = $sw->Frame; my $okbutton = $f->Button(-text => __("Ok"), - -command => sub { $val = $entry->get; callback_edit_directories($key,$val) ; $sw->destroy })->pack(-side => 'left', -padx => "2m", -pady => "2m"); + -command => sub { $val = forward_slashify($entry->get); callback_edit_directories($key,$val) ; $sw->destroy })->pack(-side => 'left', -padx => "2m", -pady => "2m"); my $cancelbutton = $f->Button(-text => __("Cancel"), -command => sub { $sw->destroy })->pack(-side => 'right', -padx => "2m", -pady => "2m"); $f->pack(-expand => 'x'); @@ -792,16 +805,16 @@ sub menu_set_pathes_text { menu_set_text($langcoltext, __("(no language collection selected!)"), -foreground => "red"); } if (TeXLive::TLUtils::texdir_check($vars{'TEXDIR'})) { - menu_set_text($texdirtext, "$vars{'TEXDIR'}", -foreground => "black"); + menu_set_text($texdirtext, native_slashify($vars{'TEXDIR'}), -foreground => "black"); } else { menu_set_text($texdirtext, __("(default not writable - please change!)"), -foreground => "red"); } - menu_set_text($texmflocaltext, "$vars{'TEXMFLOCAL'}"); + menu_set_text($texmflocaltext, native_slashify($vars{'TEXMFLOCAL'})); if ((-w $vars{'TEXMFSYSVAR'}) || (-w dirname($vars{'TEXMFSYSVAR'}))) { - menu_set_text($texmfsysvartext, "$vars{'TEXMFSYSVAR'}", -foreground => "black"); + menu_set_text($texmfsysvartext, native_slashify($vars{'TEXMFSYSVAR'}), -foreground => "black"); } elsif ("$vars{'TEXMFSYSVAR'}" =~ m;^$vars{'TEXDIR'};) { if (TeXLive::TLUtils::texdir_check($vars{'TEXDIR'})) { - menu_set_text($texmfsysvartext, "$vars{'TEXMFSYSVAR'}", -foreground => "black"); + menu_set_text($texmfsysvartext, native_slashify($vars{'TEXMFSYSVAR'}), -foreground => "black"); } else { menu_set_text($texmfsysvartext, __("(please change TEXDIR first!)"), -foreground => "red"); } @@ -809,17 +822,17 @@ sub menu_set_pathes_text { menu_set_text($texmfsysvartext, __("(default not writable - please change!)")); } if ((-w $vars{'TEXMFSYSCONFIG'}) || (-w dirname($vars{'TEXMFSYSCONFIG'}))) { - menu_set_text($texmfsysconfigtext, "$vars{'TEXMFSYSCONFIG'}", -foreground => "black"); + menu_set_text($texmfsysconfigtext, native_slashify($vars{'TEXMFSYSCONFIG'}), -foreground => "black"); } elsif ("$vars{'TEXMFSYSCONFIG'}" =~ m;^$vars{'TEXDIR'};) { if (TeXLive::TLUtils::texdir_check($vars{'TEXDIR'})) { - menu_set_text($texmfsysconfigtext, "$vars{'TEXMFSYSCONFIG'}", -foreground => "black"); + menu_set_text($texmfsysconfigtext, native_slashify($vars{'TEXMFSYSCONFIG'}), -foreground => "black"); } else { menu_set_text($texmfsysconfigtext, __("(please change TEXDIR first!)"), -foreground => "red"); } } else { menu_set_text($texmfsysconfigtext, __("(default not writable - please change!)")); } - menu_set_text($texmfhometext, "$vars{'TEXMFHOME'}"); + menu_set_text($texmfhometext, native_slashify($vars{'TEXMFHOME'})); } |