[121473] branches/gsoc14-interactive/base/src/port/port.tcl

shasha at macports.org shasha at macports.org
Thu Jun 26 08:51:18 PDT 2014


Revision: 121473
          https://trac.macports.org/changeset/121473
Author:   shasha at macports.org
Date:     2014-06-26 08:51:18 -0700 (Thu, 26 Jun 2014)
Log Message:
-----------
more minor adjustments

Modified Paths:
--------------
    branches/gsoc14-interactive/base/src/port/port.tcl

Modified: branches/gsoc14-interactive/base/src/port/port.tcl
===================================================================
--- branches/gsoc14-interactive/base/src/port/port.tcl	2014-06-26 14:42:00 UTC (rev 121472)
+++ branches/gsoc14-interactive/base/src/port/port.tcl	2014-06-26 15:51:18 UTC (rev 121473)
@@ -5380,8 +5380,9 @@
 		ui_choice $msg $name $ports
 				
 		# User Input (single input restriction)
-		puts -nonewline "Enter a number to select an option: "
 		while 1 {
+			puts -nonewline "Enter a number to select an option: "
+			flush stdout
 			set input [gets stdin]
 			if {($input <= [llength $ports] && [string is integer -strict $input])} {
 				return $input
@@ -5407,8 +5408,13 @@
 		# User Input (with Multiple input parsing) 
 		while 1 {
 			puts -nonewline "Enter the numbers to select the options: "
+			flush stdout
 			set input [gets stdin]
-			set count 1
+			set count 0
+			# check if input is non-empty and otherwise fine
+			if {$input == ""} {
+				continue
+			}
 			foreach num $input {
 				if {($num <= [llength $ports] && [string is integer -strict $num])} {
 					incr count
@@ -5417,8 +5423,8 @@
 					break
 				}
 			}
-			if {$count == [llength input]} {
-				return input
+			if {$count == [llength $input]} {
+				return $input
 			}
 		}
 	}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140626/ae121506/attachment.html>


More information about the macports-changes mailing list