Skip to content

Commit

Permalink
Fix for Issue TPC-Council#118 using diset with variables with spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
sm-shaw committed Apr 7, 2020
1 parent 00bccea commit 0964a4c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/generic/gencli.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -429,9 +429,9 @@ if {[ llength $args ] != 3} {
putscli "Error: Invalid number of arguments\nUsage: diset dict key value"
putscli "Type \"print dict\" for valid dictionaries and keys for $rdbms"
} else {
set dct [ lindex [ split $args ] 0 ]
set key2 [ lindex [ split $args ] 1 ]
set val [ lindex [ split $args ] 2 ]
set dct [ lindex $args 0 ]
set key2 [ lindex $args 1 ]
set val [ lindex $args 2 ]
upvar #0 dbdict dbdict
foreach { key } [ dict keys $dbdict ] {
set dictname config$key
Expand All @@ -441,22 +441,22 @@ if { [ dict get $dbdict $key name ] eq $rdbms } {
if {[dict exists [ set $dictname ] $dct ]} {
if {[dict exists [ set $dictname ] $dct $key2 ]} {
set previous [ dict get [ set $dictname ] $dct $key2 ]
if { $previous eq $val } {
if { $previous eq [ concat $val ] } {
putscli "Value $val for $dct:$key2 is the same as existing value $previous, no change made"
} else {
if { [ string match *driver $key2 ] } {
if { [ string match *driver $key2 ] && ![ string match *odbc_driver $key2 ] } {
putscli "Clearing Script, reload script to activate new setting"
clearscript
if { $val != "test" && $val != "timed" } {
putscli "Error: Driver script must be either \"test\" or \"timed\""
return
}
}
if { [catch {dict set $dictname $dct $key2 $val } message]} {
if { [catch {dict set $dictname $dct $key2 [ concat $val ] } message]} {
putscli "Failed to set Dictionary value: $message"
} else {
putscli "Changed $dct:$key2 from $previous to $val for $rdbms"
remote_command [ concat diset $dct $key2 $val ]
putscli "Changed $dct:$key2 from $previous to [ concat $val ] for $rdbms"
remote_command [ concat diset $dct $key2 [ list \{$val\} ]]
}}
} else {
putscli {Usage: diset dict key value}
Expand Down

0 comments on commit 0964a4c

Please sign in to comment.