From c70aa9b06deaa3373547359961e1981ffeecfb54 Mon Sep 17 00:00:00 2001 From: Stefan Schippers Date: Wed, 14 Oct 2020 16:02:05 +0200 Subject: [PATCH] update_symbol() do not throw away quotes in name attrs (name="some thing") --- src/editprop.c | 16 ++++++++++------ src/xinit.c | 1 + 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/editprop.c b/src/editprop.c index 0c056f41..152ec51e 100644 --- a/src/editprop.c +++ b/src/editprop.c @@ -1072,14 +1072,18 @@ void update_symbol(const char *result, int x) } } - /* if symbol changed ensure instance name (with new prefix char) is unique */ - my_strdup(152, &name, get_tok_value(xctx.inst[i].prop_ptr, "name", 0)); - if(name && name[0] ) { - dbg(1, "update_symbol(): prefix!='\\0', name=%s\n", name); - new_name = get_tok_value(xctx.inst[i].prop_ptr, "name", 0); + + + new_name = get_tok_value(xctx.inst[i].prop_ptr, "name", 1); /* retain quotes in name if any */ + if(new_name[0]) { if(allow_change_name || (lastselected == 1) ) my_strdup(153, &name, new_name); /* 20110325 only modify prefix if prefix not NUL */ - if(prefix) name[0]=prefix; /* change prefix if changing symbol type; */ + if(prefix) { + if(name[0] != '"') + name[0]=prefix; /* change prefix if changing symbol type; */ + else + name[1]=prefix; /* change prefix if changing symbol type; */ + } dbg(1, "update_symbol(): name=%s, xctx.inst[i].prop_ptr=%s\n", name, xctx.inst[i].prop_ptr); my_strdup(89, &ptr,subst_token(xctx.inst[i].prop_ptr, "name", name) ); /* set name of current inst */ diff --git a/src/xinit.c b/src/xinit.c index 7b309c69..5cf80266 100644 --- a/src/xinit.c +++ b/src/xinit.c @@ -1180,6 +1180,7 @@ int Tcl_AppInit(Tcl_Interp *inter) init_color_array(0.0); my_snprintf(tmp, S(tmp), "%d",debug_var); tclsetvar("tcl_debug",tmp ); + tclsetvar("menu_tcl_debug",debug_var ? "1" : "0" ); if(flat_netlist) tclsetvar("flat_netlist","1"); lw=1;