summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--urpm/msg.pm2
-rwxr-xr-xurpmi3
2 files changed, 3 insertions, 2 deletions
diff --git a/urpm/msg.pm b/urpm/msg.pm
index e7315735..bff6be5f 100644
--- a/urpm/msg.pm
+++ b/urpm/msg.pm
@@ -73,7 +73,7 @@ sub message_input {
if ($opts{boolean}) {
$input =~ /^[$noexpr$yesexpr]*$/ and last;
} elsif ($opts{range}) {
- 1 <= $input && $input <= $opts{range} and last;
+ (defined $opts{range_min} ? $opts{range_min} : 1) <= $input && $input <= $opts{range} and last;
} else {
last;
}
diff --git a/urpmi b/urpmi
index e4994cb6..44a6719b 100755
--- a/urpmi
+++ b/urpmi
@@ -400,7 +400,8 @@ sub ask_choice {
} else {
message($msg);
my $i = 0; foreach (@l) { message(" " . ++$i . "- $_") }
- $n = message_input(N("What is your choice? (1-%d) ", $i), undef, range => $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.
}
}