gui: Avoid added an extra newline to hook scripts when saving.
This commit is contained in:
		
							parent
							
								
									e1aec0ea1d
								
							
						
					
					
						commit
						bcd749578d
					
				
					 1 changed files with 5 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -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 ""
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue