From 8e8145a2414e12e4a9e270a56cf24f4b8de0f9bd Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Tue, 17 Oct 2023 23:06:49 +0200 Subject: [PATCH] fix regression on input_line tcl procedure. buggy if empty cmd ws passed as argument --- src/xschem.tcl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/xschem.tcl b/src/xschem.tcl index d6887e27..19acd551 100644 --- a/src/xschem.tcl +++ b/src/xschem.tcl @@ -5032,7 +5032,7 @@ proc swap_compare_schematics {} { } } proc input_line {txt {cmd {}} {preset {}} {w 12}} { - global wm_fix + global wm_fix retval set retval {} if { [winfo exists .dialog] } return xschem set semaphore [expr {[xschem get semaphore] +1}] @@ -5051,9 +5051,12 @@ proc input_line {txt {cmd {}} {preset {}} {w 12}} { pack .dialog.f1.l .dialog.f1.e -side left frame .dialog.f2 + button .dialog.f2.ok -text OK -command " - eval $cmd \[.dialog.f1.e get\] - set retval [.dialog.f1.e get] + if { {$cmd} ne {} } { + eval $cmd \[.dialog.f1.e get\] + } + set retval \[.dialog.f1.e get\] destroy .dialog " button .dialog.f2.cancel -text Cancel -command { destroy .dialog }