On Mon, 30 May 2011, Andreas Schwab wrote: > > + catch {set savedTZ $env(TZ)} > if {[info exits env(TZ)]} {set savedTZ $env(TZ)} That felt like a lot of noise just to save and restore an environment variable, but since I more or less learned Tcl just to write this patch, Iâll defer to your judgement of style here. Thanks, Anders diff --git a/gitk b/gitk index c77771e..6a4c8ed 100755 --- a/gitk +++ b/gitk @@ -11026,14 +11026,20 @@ proc formatdate {d} { if {[string match {*%[zZ]*} $datetimeformat]} { if {[catch {set d [clock format [lindex $d 0] -timezone [lindex $d 1] -format $datetimeformat]}]} { # Tcl < 8.5 does not support -timezone. Emulate it by - # setting TZ=UnknownÂNNNN. + # setting TZ=UnknownÂNN:NN. global env - catch {set savedTZ $env(TZ)} + if {[info exists env(TZ)]} { + set savedTZ $env(TZ) + } set zone [lindex $d 1] set sign [string map {+ - - +} [string index $zone 0]] set env(TZ) Unknown$sign[string range $zone 1 2]:[string range $zone 3 4] set d [clock format [lindex $d 0] -format $datetimeformat] - if {[catch {set env(TZ) $savedTZ}]} {unset env(TZ)} + if {[info exists savedTZ]} { + set env(TZ) $savedTZ + } else { + unset env(TZ) + } } } else { set d [clock format [lindex $d 0] -format $datetimeformat] -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html