Posted to tcl by emiliano at Tue May 31 18:36:54 GMT 2022view raw

  1. Open console and type [set Options(BridgeNames)]
  2.  
  3. The bug is in the proc ::tkchat::CheckVersionDone
  4.  
  5. Here's a patch
  6.  
  7. Index: apps/tkchat/tkchat.tcl
  8. ==================================================================
  9. --- apps/tkchat/tkchat.tcl
  10. +++ apps/tkchat/tkchat.tcl
  11. @@ -9985,22 +9985,22 @@
  12. }
  13.  
  14. proc ::tkchat::CheckVersionDone {tok} {
  15. variable version
  16. global Options
  17. - set meta [set [set tok](meta)]
  18. - if {[set ndx [lsearch -exact $meta X-LOLCATZ]] != -1} {
  19. - set Options(tagline) "LOLCat says \"[lindex $meta [incr ndx]]\""
  20. + set meta [http::meta $tok]
  21. + if {[dict exists $meta X-LOLCATZ]} {
  22. + set Options(tagline) "LOLCat says \"[dict get $meta X-LOLCATZ]\""
  23. if {!$Options(HateLolcatz)} {
  24. - after 10000 [list [namespace origin addStatus] 0 $::Options(tagline)]
  25. + after 10000 [list [namespace origin addStatus] 0 $Options(tagline)]
  26. }
  27. }
  28. # This permits the website to re-define the names of current bridges.
  29. - if {[set ndx [lsearch -exact $meta X-BridgeNames]] != -1} {
  30. - set bridges [lindex $meta [incr ndx]]
  31. - if {[llength $bridges] > 0} {
  32. - lappend Options(BridgeNames) {*} $bridges
  33. + if {[dict exists $meta X-BridgeNames]} {
  34. + set bridges [dict get $meta X-BridgeNames]
  35. + if {[llength $bridges]} {
  36. + set Options(BridgeNames) $bridges
  37. }
  38. }
  39. set url [string trim [http::data $tok]]
  40. if {[regexp {1\.(\d+)} $version -> current]
  41. && [regexp {tkchat-1\.(\d+)} $url -> latest]} {
  42.  
  43.