From 7da63c19e2583fd3844e637d009922aeaf7ec276 Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Sat, 18 Nov 2023 01:49:50 +0100 Subject: [PATCH] regression fix: xschem netlist did not return exit code --- src/scheduler.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/scheduler.c b/src/scheduler.c index 7f846db5..cb18f8ec 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -2661,6 +2661,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg int messages = 0; const char *fname = NULL; const char *path; + int done_netlist = 0; if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;} yyparse_error = 0; my_strdup(_ALLOC_ID_, &saveshow, tclgetvar("show_infowindow_after_netlist")); @@ -2684,6 +2685,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg } } if(set_netlist_dir(0, NULL) ) { + done_netlist = 1; if(xctx->netlist_type == CAD_SPICE_NETLIST) err = global_spice_netlist(1); /* 1 means global netlist */ else if(xctx->netlist_type == CAD_VHDL_NETLIST) @@ -2698,11 +2700,6 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg if(argc > 2) { my_strncpy(xctx->netlist_name, "", S(xctx->netlist_name)); } - if(messages) { - Tcl_SetResult(interp, xctx->infowindow_text, TCL_VOLATILE); - } else { - Tcl_SetResult(interp, my_itoa(err), TCL_VOLATILE); - } } else { if(has_x) tcleval("alert_ {Can not write into the netlist directory. Please check} {}"); @@ -2721,6 +2718,13 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg } } tclsetvar("show_infowindow_after_netlist", saveshow); + if(done_netlist) { + if(messages) { + Tcl_SetResult(interp, xctx->infowindow_text, TCL_VOLATILE); + } else { + Tcl_SetResult(interp, my_itoa(err), TCL_VOLATILE); + } + } my_free(_ALLOC_ID_, &saveshow); }