From 72f365f995f2afaa5a247efb76289dc163544fc3 Mon Sep 17 00:00:00 2001 From: Stefan Frederik Date: Thu, 16 Dec 2021 23:09:23 +0100 Subject: [PATCH] fix regression in tclgetvar() not returning NULL for non existent variables (place text dialog box did not show text size) --- src/actions.c | 4 ++-- src/scheduler.c | 4 ++-- src/xschem.tcl | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/actions.c b/src/actions.c index 3b909cce..a2929ae6 100644 --- a/src/actions.c +++ b/src/actions.c @@ -2310,9 +2310,9 @@ int place_text(int draw_text, double mx, double my) tclsetvar("props",""); tclsetvar("retval",""); - if(tclgetvar("hsize")==NULL) + if(!tclgetvar("hsize")) tclsetvar("hsize","0.4"); - if(tclgetvar("vsize")==NULL) + if(!tclgetvar("vsize")) tclsetvar("vsize","0.4"); tcleval("enter_text {text:} normal"); diff --git a/src/scheduler.c b/src/scheduler.c index 1e420f56..ca971e0d 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -2797,8 +2797,8 @@ const char *tclgetvar(const char *s) const char *p; p = Tcl_GetVar(interp, s, TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG); if(!p) { - dbg(0, "%s\n", tclresult()); - return ""; + dbg(1, "%s\n", tclresult()); + return NULL; } return p; } diff --git a/src/xschem.tcl b/src/xschem.tcl index 652fbc99..80b0a874 100644 --- a/src/xschem.tcl +++ b/src/xschem.tcl @@ -3660,7 +3660,7 @@ set tctx::global_list { dark_colorscheme dim_bg dim_value disable_unique_names do_all_inst draw_grid draw_window edit_prop_pos edit_prop_size editprop_sympath edit_symbol_prop_new_sel enable_dim_bg enable_stretch en_hilight_conn_inst filetmp - flat_netlist fullscreen gaw_fd gaw_tcp_address globfilter hide_symbols hspice_netlist + flat_netlist fullscreen gaw_fd gaw_tcp_address globfilter hide_symbols hsize hspice_netlist incr_hilight infowindow_text INITIALINSTDIR INITIALLOADDIR INITIALPROPDIR INITIALTEXTDIR input_line_cmd input_line_data launcher_default_program light_colors line_width local_netlist_dir myload_d myload_default_geometry myload_dir1 myload_dir2 myload_dirs2 myload_files1 myload_files2 myload_index1 @@ -3673,7 +3673,7 @@ set tctx::global_list { text_line_default_geometry textwindow_fileid textwindow_filename textwindow_w tmp_bus_char toolbar_horiz toolbar_visible top_subckt transparent_svg undo_type use_label_prefix use_lab_wire user_wants_copy_cell verilog_2001 - viewdata_fileid viewdata_filename viewdata_w xschem_libs xschem_listen_port + viewdata_fileid viewdata_filename viewdata_w vsize xschem_libs xschem_listen_port } ## list of global arrays to save/restore on context switching