Tk Library Source Code

Artifact [6dc20012cb]
Login

Artifact 6dc20012cbb898e0865a7ebbbb178f28d6d47086:

Attachment "pat.tkchat.clean" to ticket [702169ffff] added by lvirden 2003-03-12 23:48:47.
--- tkchat.tcl	2003-03-11 02:13:54.000000000 -0500
+++ /projects/xopsrc/bin/tkchat.tcl	2003-03-11 05:45:11.000000000 -0500
@@ -39,3 +39,3 @@
 				;# that apps are not packages.  :)  DGP
-package provide app-tkchat [regexp -inline {\d+\.\d+} {$Revision: 1.90 $}]
+package provide app-tkchat [regexp -inline -- {\d+\.\d+} {$Revision: 1.90 $}]
 
@@ -208,3 +208,3 @@
                     # trim off the /?M=D part
-                    regsub {/\?M=D} $Options(URLlogs) {} Options(URLlogs)
+                    regsub -- {/\?M=D} $Options(URLlogs) {} Options(URLlogs)
                     set loglist [::tkchat::GetHistLogIdx ary]
@@ -226,2 +226,3 @@
 	}
+        default { ; }
     }
@@ -278,2 +279,3 @@
         }
+	default { ; }
     }
@@ -418,2 +420,3 @@
 	}
+	default { ; }
     }
@@ -466,2 +469,3 @@
 	error	{ tk_messageBox -message "Logon Error: [::http::error $tok]" }
+	default { ; }
     }
@@ -596,2 +600,3 @@
 	}
+	default { ; }
     }
@@ -666,2 +671,3 @@
 	}
+	default { ; }
     }
@@ -689,2 +695,3 @@
 	}
+	default { ; }
     }
@@ -712,3 +719,3 @@
     set ::tkchat::translate [http::data $tok]
-    set r [regexp {<Div.*?>(.*)</div>} \
+    set r [regexp -- {<Div.*?>(.*)</div>} \
             [::http::data $tok] -> text]
@@ -732,3 +739,3 @@
     set ::tkchat::babelfish [http::data $tok]
-    if {[regexp {<select name="lp">(.*?)</select>} [::http::data $tok] -> r]} {
+    if {[regexp -- {<select name="lp">(.*?)</select>} [::http::data $tok] -> r]} {
         .mbar.help.tr delete 0 end
@@ -736,3 +743,3 @@
         foreach option $lst {
-            regexp {<option value="(.*?)"[^>]*>(.*?)</option>} \
+            regexp -- {<option value="(.*?)"[^>]*>(.*?)</option>} \
                     $option -> value label
@@ -978,3 +985,3 @@
     # remove any remaining tags
-    regsub -all -nocase "<.*?>" $str {} tmp
+    regsub -all -nocase -- "<.*?>" $str {} tmp
     # replace html escapes with real chars
@@ -1102,3 +1109,3 @@
 	if {[string equal $nick "ircbridge"] && \
-		[regexp {^([^ ]+) says: (.*)$} $str -> truenick msg]} {
+		[regexp -- {^([^ ]+) says: (.*)$} $str -> truenick msg]} {
 	    # Use their true nick, but display bridge users as <$nick>
@@ -1108,3 +1115,3 @@
 	    set str  $msg
-	    if { [regexp {ACTION (.+)} $str -> action] } {
+	    if { [regexp -- {ACTION (.+)} $str -> action] } {
 		addAction $clr "<$nick>" [string range $action 0 end-1]
@@ -1281,2 +1288,3 @@
 	}
+	default { ; }
     }
@@ -1425,3 +1433,3 @@
     foreach {str url} [parseStr $str] {
-	regsub -all "\n" $str "\n\t" str
+	regsub -all -- "\n" $str "\n\t" str
 	if {[string equal $url ""]} {
@@ -2037,3 +2045,3 @@
 
-    if { [regexp {^/\?(.+)} $msg -> newSearch] } {
+    if { [regexp -- {^/\?(.+)} $msg -> newSearch] } {
 	if { ![string equal $newSearch $searchString] } {
@@ -2047,3 +2055,3 @@
 	    for { set i 0 } { $i < [llength $marks] } { incr i 2 } {
-		.txt tag remove found [lindex $marks $i] [lindex $marks [expr $i+1]]
+		.txt tag remove found [lindex $marks $i] [lindex $marks [expr {$i+1}]]
 	    }
@@ -2066,3 +2074,3 @@
 		.txt tag add found $foundAt \
-		    "$foundLine.[expr $foundChar + $foundLength]"
+		    "$foundLine.[expr {$foundChar + $foundLength}]"
 
@@ -2070,6 +2078,6 @@
 		    # decrement line no, not char pos.
-		    set offset "[expr $foundLine -1].99999"
+		    set offset "[expr {$foundLine - 1}].99999"
 		} else {
 		    # decrement char pos:
-		    set offset "$foundLine.[expr $foundChar - 1]"
+		    set offset "$foundLine.[expr {$foundChar - 1}]"
 		}
@@ -2107,6 +2115,6 @@
 		# decrement line no, not char pos.
-		set searchOffset "[expr $foundLine -1].99999"
+		set searchOffset "[expr {$foundLine - 1}].99999"
 	    } else {
 		# decrement char pos:
-		set searchOffset "$foundLine.[expr $foundChar - 1]"
+		set searchOffset "$foundLine.[expr {$foundChar - 1}]"
 	    }
@@ -2361,2 +2369,3 @@
 	    }
+	    default { ; }
 	}
@@ -2414,2 +2423,3 @@
         }
+	default { ; }
     }
@@ -2456,2 +2466,3 @@
         }
+	default { ; }
     }
@@ -2585,2 +2596,3 @@
 	}
+	default { ; }
     }
@@ -2939,3 +2951,3 @@
                        -font NAME -tabs {1.5i l 2.0i l} \
-                       -height [expr [llength [image names]] + 5]]
+                       -height [expr {[llength [image names]] + 5}]]
         foreach image [lsort [image names]] {
@@ -3068,3 +3080,3 @@
 	} elseif {[info exists ::env(http_proxy)]} {
-	    if {[regexp {(?:http://)?([[:alnum:].-]+)(?::(\d+))?} \
+	    if {[regexp -- {(?:http://)?([[:alnum:].-]+)(?::(\d+))?} \
                      $::env(http_proxy) -> \
@@ -3534,3 +3546,3 @@
 	variable Family
-	if {[string length $char] && ![regexp {[]*?\\[]} $char]} {
+	if {[string length $char] && ![regexp -- {[]*?\\[]} $char]} {
 	    set idx [lsearch -glob ['list_families] $char*]
@@ -3824,3 +3836,3 @@
     }
-    switch $tcl_platform(platform) {
+    switch -- $tcl_platform(platform) {
 	windows {