From b2e12251dcb867b423f197b642e740855a0d363e Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Tue, 30 Sep 2025 09:38:19 +0200 Subject: [PATCH] set_initial_dirs: do not reset INITIAL*DIR if already set --- src/xschem.tcl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/xschem.tcl b/src/xschem.tcl index e7b055cf..795ecb97 100644 --- a/src/xschem.tcl +++ b/src/xschem.tcl @@ -9888,17 +9888,17 @@ tclcommand=\"xschem raw_read \$netlist_dir/[file tail [file rootname [xschem get proc set_initial_dirs {} { global INITIALLOADDIR INITIALINSTDIR INITIALPROPDIR pathlist - set INITIALLOADDIR {} - set INITIALINSTDIR {} - set INITIALPROPDIR {} foreach i $pathlist { if { [file exists $i] } { - set INITIALLOADDIR $i - set INITIALINSTDIR $i - set INITIALPROPDIR $i + if {![info exists INITIALLOADDIR]} {set INITIALLOADDIR $i} + if {![info exists INITIALINSTDIR]} {set INITIALINSTDIR $i} + if {![info exists INITIALPROPDIR]} {set INITIALPROPDIR $i} break } } + if {![info exists INITIALLOADDIR]} {set INITIALLOADDIR {}} + if {![info exists INITIALINSTDIR]} {set INITIALINSTDIR {}} + if {![info exists INITIALPROPDIR]} {set INITIALPROPDIR {}} } # called whenever XSCHEM_LUBRARY_PATH changes (see trace command at end)