Changeset 146730 for trunk/base


Ignore:
Timestamp:
Mar 16, 2016, 10:04:56 AM (4 years ago)
Author:
ijackson@…
Message:

ui_ask_singlechoice returns 0-based index instead of 1-based

Update proc _check_registry{} in portimage.tcl to return the
new 0-based index instead of using the old 1-based index.

Location:
trunk/base/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/port/port.tcl

    r146719 r146730  
    54475447            signal -restart error {TERM INT}
    54485448            if {($input <= [llength $ports] && [string is integer -strict $input])} {
    5449                 return $input
     5449                return [expr {$input - 1}]
    54505450            } else {
    54515451                puts "Please enter an index from the above list."
  • trunk/base/src/registry2.0/portimage.tcl

    r138099 r146730  
    253253        if {[info exists macports::ui_options(questions_singlechoice)]} {
    254254            set retvalue [$macports::ui_options(questions_singlechoice) $msg "Choice_Q1" $portilist]
    255             set index [expr { $retvalue - 1 }]
    256             return [lindex $ilist $index]
     255            return [lindex $ilist $retvalue]
    257256        }
    258257        throw registry::invalid "Registry error: Please specify the full version as recorded in the port registry."
Note: See TracChangeset for help on using the changeset viewer.