From b8fa5fa2b0072ebd19528bb0522553499ee948d4 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 18 Feb 2005 19:33:24 +0000 Subject: ensure the "range" entry returned value is bounded as asked (useful for backends not handling "range" correctly, like interactive::newt) (bugzilla #13744) --- perl-install/interactive.pm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'perl-install') diff --git a/perl-install/interactive.pm b/perl-install/interactive.pm index 1d704112e..d577ded21 100644 --- a/perl-install/interactive.pm +++ b/perl-install/interactive.pm @@ -406,6 +406,13 @@ sub ask_from_real { my ($o, $common, $l) = @_; my ($l1, $l2) = partition { !$_->{advanced} } @$l; my $v = $o->ask_fromW($common, $l1, $l2); + + foreach my $e (@$l1, @$l2) { + if ($e->{type} eq 'range') { + ${$e->{val}} = max($e->{min}, min(${$e->{val}}, $e->{max})); + } + } + %$common = (); $v; } -- cgit v1.2.1