From 2c1852faef5b6d5a769619b1c1b902d4f404aa91 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 8 Mar 2001 17:03:48 +0000 Subject: (ask_from_listf_no_check): catch wizcancel and return undef --- perl-install/interactive.pm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'perl-install/interactive.pm') diff --git a/perl-install/interactive.pm b/perl-install/interactive.pm index 4b9079987..ea1945269 100644 --- a/perl-install/interactive.pm +++ b/perl-install/interactive.pm @@ -131,10 +131,13 @@ sub ask_from_listf_no_check { my ($o, $title, $message, $f, $l, $def, $help) = @_; if (@$l <= 2 && !$::isWizard) { - ask_from_entries_refH_powered_no_check($o, - { title => $title, messages => $message, ok => $l->[0] && may_apply($f, $l->[0]), - if_($l->[1], cancel => may_apply($f, $l->[1]), focus_cancel => $def eq $l->[1]) }, [] - ) ? $l->[0] : $l->[1]; + my $ret = eval { + ask_from_entries_refH_powered_no_check($o, + { title => $title, messages => $message, ok => $l->[0] && may_apply($f, $l->[0]), + if_($l->[1], cancel => may_apply($f, $l->[1]), focus_cancel => $def eq $l->[1]) }, [] + ) ? $l->[0] : $l->[1]; + }; + $@ =~ /^wizcancel/ ? undef : $ret; } else { ask_from_entries_refH($o, $title, $message, [ { val => \$def, type => 'list', list => $l, help => $help, format => $f } ]) && $def; } -- cgit v1.2.1