From bcd749578dee16f5b94d9f39cbad0b750b5d492d Mon Sep 17 00:00:00 2001 From: Tom Goff Date: Thu, 29 Sep 2016 17:26:50 -0400 Subject: [PATCH] gui: Avoid added an extra newline to hook scripts when saving. --- gui/cfgparse.tcl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gui/cfgparse.tcl b/gui/cfgparse.tcl index b8b27032..ce84e81e 100644 --- a/gui/cfgparse.tcl +++ b/gui/cfgparse.tcl @@ -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 "" }