diff --git a/src/xinit.c b/src/xinit.c index 2fb25fe8..2125d159 100644 --- a/src/xinit.c +++ b/src/xinit.c @@ -3083,6 +3083,11 @@ int Tcl_AppInit(Tcl_Interp *inter) /* */ tcleval("source_user_tcl_files"); + /* */ + /* Execute tcl commands given in tcl variable postinit_commands if existing */ + /* */ + tcleval("eval_postinit_commands"); + if(cli_opt_filename[0]) { char f[PATH_MAX]; int file_loaded = 1; @@ -3234,9 +3239,6 @@ int Tcl_AppInit(Tcl_Interp *inter) tcleval(cli_opt_tcl_post_command); } - /* Execute tcl commands given in tcl variable postinit_commands if existing */ - tcleval("eval_postinit_commands"); - if(cli_opt_quit) { char s[40]; my_snprintf(s, S(s), "exit %d", exit_code); diff --git a/src/xschem.tcl b/src/xschem.tcl index 0eeb5520..d5b2aaf0 100644 --- a/src/xschem.tcl +++ b/src/xschem.tcl @@ -9868,9 +9868,11 @@ proc set_replace_key_binding { {win_path {.drw}}} { } proc source_user_tcl_files {} { - global tcl_files - foreach i $tcl_files { - uplevel #0 [list source $i] + set subst_tcl_files [uplevel #0 {subst $tcl_files}] + foreach i $subst_tcl_files { + if {[catch "uplevel #0 {[list source $i]}" retval]} { + puts $retval + } } }