summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--urpm/msg.pm4
-rwxr-xr-xurpmi1
2 files changed, 3 insertions, 2 deletions
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 = <STDIN>;
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;
diff --git a/urpmi b/urpmi
index 170cf28c..1be42658 100755
--- a/urpmi
+++ b/urpmi
@@ -411,7 +411,6 @@ sub ask_choice {
message($msg);
my $i = 0; foreach (@l) { message(" " . ++$i . "- $_") }
$n = message_input(N("What is your choice? (1-%d) ", $i), undef, range_min => 0, range => $i);
- chomp $n;
defined($n) && $n ne "0" or exit 1; # abort.
}
}