summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-09-10 16:21:56 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-09-10 16:21:56 +0000
commitb1c429a644e553fa2534b5910fcfca1c9d5673a9 (patch)
treeac4e1afce3cfa892154bb37414662989ed8ffad5 /urpm
parentcab13c537afddd8915df0c90735c3a7b65fb22d2 (diff)
downloadurpmi-b1c429a644e553fa2534b5910fcfca1c9d5673a9.tar
urpmi-b1c429a644e553fa2534b5910fcfca1c9d5673a9.tar.gz
urpmi-b1c429a644e553fa2534b5910fcfca1c9d5673a9.tar.bz2
urpmi-b1c429a644e553fa2534b5910fcfca1c9d5673a9.tar.xz
urpmi-b1c429a644e553fa2534b5910fcfca1c9d5673a9.zip
implement default choice for range
(previous tentative was not very good. i don't know in which case $input is undef)
Diffstat (limited to 'urpm')
-rw-r--r--urpm/msg.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/urpm/msg.pm b/urpm/msg.pm
index daa1c55e..95938516 100644
--- a/urpm/msg.pm
+++ b/urpm/msg.pm
@@ -106,13 +106,13 @@ sub _message_input {
return $o_default_input;
}
$input = <STDIN>;
- defined $input or return $o_opts{default};
+ defined $input or return undef;
chomp $input;
$urpm::args::options{bug} and bug_log($input);
if ($o_opts{boolean}) {
$input =~ /^[$noexpr$yesexpr]?$/ and last;
} elsif ($o_opts{range}) {
- $input eq "" and $input = 1; #- defaults to first choice
+ $input eq "" and $input = $o_opts{default}; #- defaults to first choice
(defined $o_opts{range_min} ? $o_opts{range_min} : 1) <= $input && $input <= $o_opts{range} and last;
} else {
last;