Fix style to avoid double substitution
patch d6716f5f719e0e6b712139717e6df63ca44fd4db
Author: Enrique D. Bosch <presidev@AT@gmail.com>
Date: Tue Sep 5 22:19:09 CEST 2017
* Fix style to avoid double substitution
hunk ./idlebiff 30
-proc and { args } { set a 1; foreach b $args { set a [ expr $a && $b ]; if !$a { return 0 } }; return $a }
-proc or { args } { set a 0; foreach b $args { set a [ expr $a || $b ]; if $a { return 1 } }; return $a }
+proc and args { set a 1; foreach b $args { set a [ expr $a && $b ]; if { !$a } { return 0 } }; return $a }
+proc or args { set a 0; foreach b $args { set a [ expr $a || $b ]; if { $a } { return 1 } }; return $a }
hunk ./idlebiff 71
-proc define_pixmaps { } \
+proc define_pixmaps {} \
hunk ./idlebiff 83
-proc icon { } \
+proc icon {} \
hunk ./idlebiff 103
- if $size_not_same { error }
+ if { $size_not_same } { error }
hunk ./idlebiff 108
- if [ and $conf(pos_x) $conf(pos_y) ] { append geom + $conf(pos_x) + $conf(pos_y) }
+ if {[ and $conf(pos_x) $conf(pos_y) ]} { append geom + $conf(pos_x) + $conf(pos_y) }
hunk ./idlebiff 134
- if $bad { set textbad "WRONG PASSWORD\n" } \
- else { set textbad "" }
- if !$conf(tls) { set nv "\nWARNING: INSECURE CONNECTION" }
+ if { $bad } { set textbad "WRONG PASSWORD\n" } \
+ else { set textbad {} }
+ if { !$conf(tls) } { set nv "\nWARNING: INSECURE CONNECTION" }
hunk ./idlebiff 162
- if $conf(tip) { tooltip::tooltip .frame.canvas $new_messages }
+ if { $conf(tip) } { tooltip::tooltip .frame.canvas $new_messages }
hunk ./idlebiff 165
-proc read_conf { } \
+proc read_conf {} \
hunk ./idlebiff 170
- if [ == $argn 1 ] { set config $arg } else { set config "$::env(HOME)/.idlebiffrc" }
+ if {[ == $argn 1 ]} { set config $arg } else { set config "$::env(HOME)/.idlebiffrc" }
hunk ./idlebiff 172
- while { [ >= [ gets $cf lin ] 0 ] } \
+ while {[ >= [ gets $cf lin ] 0 ]} \
hunk ./idlebiff 174
- if [ == [ string index [ string trim $lin ] 0 ] # ] continue
+ if {[ == [ string index [ string trim $lin ] 0 ] # ]} continue
hunk ./idlebiff 182
-proc set_params { } \
+proc set_params {} \
hunk ./idlebiff 188
- if [ info exists conf(criteria) ] { if [ ne $conf(criteria) "" ] { set criteria $conf(criteria) } } \
+ if {[ info exists conf(criteria) ]} { if {[ ne $conf(criteria) {} ]} { set criteria $conf(criteria) } } \
hunk ./idlebiff 193
-proc set_search_params { } \
+proc set_search_params {} \
hunk ./idlebiff 200
- if $cap(esearch) \
+ if { $cap(esearch) } \
hunk ./idlebiff 212
-proc set_timeout { } \
+proc set_timeout {} \
hunk ./idlebiff 228
-proc cancel_timeout { } \
+proc cancel_timeout {} \
hunk ./idlebiff 233
- if [ info exists tevent($teidi) ] \
+ if {[ info exists tevent($teidi) ]} \
hunk ./idlebiff 243
- if [ catch { set res [ eval "$com [ join $args]" ] } ] \
+ if {[ catch { set res [ eval "$com [ join $args]" ] } ]} \
hunk ./idlebiff 265
-# if [regexp {.*LOGIN.*} $com] {puts "C: [string range $com 0 10]"} else {puts "C: $com"}
- if [ catch { puts $con $com } ] \
+# if {[regexp {.*LOGIN.*} $com]} {puts "C: [string range $com 0 10]"} else {puts "C: $com"}
+ if {[ catch { puts $con $com } ]} \
hunk ./idlebiff 278
- if [ == $tag 10000 ] { set tag 1 }
- append tcom $prefix [ format %04d $tag ] " " $com
+ if {[ == $tag 10000 ]} { set tag 1 }
+ append tcom $prefix [ format %04d $tag ] { } $com
hunk ./idlebiff 305
- if $cap(logindisabled) { error logindisabled }
-
- if $retr { unset conf(pass) }
- if ![ info exists conf(pass) ] { set conf(pass) [ get_password $retr ] }
+ if { $cap(logindisabled) } { error logindisabled }
+
+ if { $retr } { unset conf(pass) }
+ if { ![ info exists conf(pass) ] } { set conf(pass) [ get_password $retr ] }
hunk ./idlebiff 325
-proc force_down { } \
+proc force_down {} \
hunk ./idlebiff 366
- if [ regexp -nocase -lineanchor $rexp_chk $linea ] \
+ if {[ regexp -nocase -lineanchor $rexp_chk $linea ]} \
hunk ./idlebiff 368
- if [ eq $args logindisabled ] { set cap(logindisabled_chk) 1 } \
+ if {[ eq $args logindisabled ]} { set cap(logindisabled_chk) 1 } \
hunk ./idlebiff 372
- if !$cap($capname) \
+ if { !$cap($capname) } \
hunk ./idlebiff 390
- if $check { do_search $con } \
+ if { $check } { do_search $con } \
hunk ./idlebiff 401
- if !$cap(idle) { error noidle }
+ if { !$cap(idle) } { error noidle }
hunk ./idlebiff 415
- if [ ok_untagged $linea ] \
+ if {[ ok_untagged $linea ]} \
hunk ./idlebiff 417
- if $cap(logindisabled_chk) \
+ if { $cap(logindisabled_chk) } \
hunk ./idlebiff 436
- if [ ok_tagged $linea A ] \
+ if {[ ok_tagged $linea A ]} \
hunk ./idlebiff 438
- if $cap(logindisabled_chk) \
+ if { $cap(logindisabled_chk) } \
hunk ./idlebiff 452
- if [ ok_tagged $linea A ] \
+ if {[ ok_tagged $linea A ]} \
hunk ./idlebiff 454
- if $cap(chk) { init_idle $con } \
+ if { $cap(chk) } { init_idle $con } \
hunk ./idlebiff 461
- elseif [ no_tagged $linea ] { login $con 1 }
+ elseif {[ no_tagged $linea ]} { login $con 1 }
hunk ./idlebiff 468
- if [ ok_tagged $linea A ] { init_idle $con }
+ if {[ ok_tagged $linea A ]} { init_idle $con }
hunk ./idlebiff 475
- if [ catch { set linea [ read_line $con ] } ] return
+ if {[ catch { set linea [ read_line $con ] } ]} return
hunk ./idlebiff 477
- if [ eq $prim + ] { set idle 1 } \
- elseif $idle { if [ eq $prim * ] { idle_cycle $con 1 } } \
+ if {[ eq $prim + ]} { set idle 1 } \
+ elseif { $idle } { if {[ eq $prim * ]} { idle_cycle $con 1 } } \
hunk ./idlebiff 493
- if [ regexp -lineanchor -nocase $rexpsearch $linea -> res ] \
+ if {[ regexp -lineanchor -nocase $rexpsearch $linea -> res ]} \
hunk ./idlebiff 495
- if $cap(esearch) { set pmsgs $res } else { incr pmsgs [ llength $res ] }
+ if { $cap(esearch) } { set pmsgs $res } else { incr pmsgs [ llength $res ] }
hunk ./idlebiff 498
- if [ and $search_resp [ ok_tagged $linea A ] ] \
+ if {[ and $search_resp [ ok_tagged $linea A ] ]} \
hunk ./idlebiff 504
- if [ > $new_messages 0 ] \
+ if {[ > $new_messages 0 ]} \
hunk ./idlebiff 509
- if [ no_tagged $linea ] { error search }
+ if {[ no_tagged $linea ]} { error search }
hunk ./idlebiff 515
- if [ catch { set r [ gets $con line ] } ] \
+ if {[ catch { set r [ gets $con line ] } ]} \
hunk ./idlebiff 520
- if [ regexp -lineanchor -nocase {^\* bye(?: .*|$)} $line ] \
+ if {[ regexp -lineanchor -nocase {^\* bye(?: .*|$)} $line ]} \
hunk ./idlebiff 525
- if [ and [ < $r 1 ] [ eof $con ] ] \
+ if {[ and [ < $r 1 ] [ eof $con ] ]} \
hunk ./idlebiff 551
- if [ info exists conf(tls_ca_subject) ] \
+ if {[ info exists conf(tls_ca_subject) ]} \
hunk ./idlebiff 553
- if [ and [ ne $conf(tls_ca_subject) "" ] [ eq $type "verify" ] [ eq $ca(subject) $ca(issuer) ] ] \
+ if {[ and [ ne $conf(tls_ca_subject) {} ] [ eq $type verify ] [ eq $ca(subject) $ca(issuer) ] ]} \
hunk ./idlebiff 556
- if !$ccsp \
+ if { !$ccsp } \
hunk ./idlebiff 563
- if ![ info exists csu($i) ] { error cert }
- if [ ne $csu($i) $ccsu($i) ] { error cert }
+ if { ![ info exists csu($i) ] } { error cert }
+ if {[ ne $csu($i) $ccsu($i) ]} { error cert }
hunk ./idlebiff 570
-proc init_tls { } \
+proc init_tls {} \
hunk ./idlebiff 575
- if $conf(tls) \
+ if { $conf(tls) } \
hunk ./idlebiff 578
- if [ >= $tlsv 1.6.4 ] { set tls1x {-tls1.1 1 -tls1.2 1} } \
+ if {[ >= $tlsv 1.6.4 ]} { set tls1x {-tls1.1 1 -tls1.2 1} } \
hunk ./idlebiff 593
-proc init { } \
+proc init {} \
hunk ./idlebiff 600
- fconfigure $con -blocking 0 -buffering line -translation "crlf crlf"
+ fconfigure $con -blocking 0 -buffering line -translation {crlf crlf}
hunk ./idlebiff 602
- if $conf(initial_noop) { imap_command_tagged $con N NOOP }
+ if { $conf(initial_noop) } { imap_command_tagged $con N NOOP }