From e4daecb730c13bf6df7b61f9e6ef700935cbc7ae Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Wed, 24 Nov 2004 08:51:23 +0000 Subject: When asking for choices, default to the first one --- urpm/msg.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'urpm') diff --git a/urpm/msg.pm b/urpm/msg.pm index 308deda3..8c681fa9 100644 --- a/urpm/msg.pm +++ b/urpm/msg.pm @@ -70,10 +70,12 @@ sub message_input { } $input = ; defined $input or return undef; + chomp $input; $urpm::args::options{bug} and log_it($input); if ($opts{boolean}) { - $input =~ /^[$noexpr$yesexpr]*$/ and last; + $input =~ /^[$noexpr$yesexpr]?$/ and last; } elsif ($opts{range}) { + $input eq "" and $input = 1; #- defaults to first choice (defined $opts{range_min} ? $opts{range_min} : 1) <= $input && $input <= $opts{range} and last; } else { last; -- cgit v1.2.1