gui: Avoid added an extra newline to hook scripts when saving.

This commit is contained in:
Tom Goff 2016-09-29 17:26:50 -04:00
parent e1aec0ea1d
commit bcd749578d

View file

@ -198,9 +198,12 @@ proc dumpCfg {method dest} {
set state [lindex $hook 1]
set script [lindex $hook 2]
dumpputs $method $dest "hook $state:$name \{"
foreach line [split $script "\n"] {
dumpputs $method $dest "$line"
# remove the final newline here because dumpputs adds a
# newline automatically
if {[string index $script end] == "\n"} {
set script [string replace $script end end]
}
dumpputs $method $dest $script
dumpputs $method $dest "\}"
dumpputs $method $dest ""
}