summaryrefslogtreecommitdiffstats
path: root/perl-install/interactive.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-09-22 11:26:53 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-09-22 11:26:53 +0000
commit5ccb00978c203295c4bf726a9530c8d696a9f286 (patch)
tree91ffea3e43557824bdc775e8b122af2320004961 /perl-install/interactive.pm
parent8507f5529c1fa95cf068076001adc1dbdc91e4fc (diff)
downloaddrakx-backup-do-not-use-5ccb00978c203295c4bf726a9530c8d696a9f286.tar
drakx-backup-do-not-use-5ccb00978c203295c4bf726a9530c8d696a9f286.tar.gz
drakx-backup-do-not-use-5ccb00978c203295c4bf726a9530c8d696a9f286.tar.bz2
drakx-backup-do-not-use-5ccb00978c203295c4bf726a9530c8d696a9f286.tar.xz
drakx-backup-do-not-use-5ccb00978c203295c4bf726a9530c8d696a9f286.zip
no_comment
Diffstat (limited to 'perl-install/interactive.pm')
-rw-r--r--perl-install/interactive.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/perl-install/interactive.pm b/perl-install/interactive.pm
index 8096c4a0c..46c4250d1 100644
--- a/perl-install/interactive.pm
+++ b/perl-install/interactive.pm
@@ -97,12 +97,15 @@ sub ask_from_listf_ {
}
sub ask_from_listf {
my ($o, $title, $message, $f, $l, $def) = @_;
+ my $def2;
my (@l,%l); my $i = 0; foreach (@$l) {
my $v = $f->($_, $i++);
push @l, $v;
$l{$v} = $_;
+ $def2 = $v if $def && $_ eq $def;
}
- my $r = ask_from_list($o, $title, $message, \@l, defined $def ? $f->($def) : $def) or return;
+ $def2 ||= $f->($def) if $def;
+ my $r = ask_from_list($o, $title, $message, \@l, $def2) or return;
$l{$r};
}