From daec7b0c18568a18fe85cfd8ef64ba1b987eda39 Mon Sep 17 00:00:00 2001 From: holger Date: Fri, 22 May 2020 14:02:53 +0200 Subject: [PATCH 1/2] definitely exclude command completion in shared ngspice --- src/sharedspice.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sharedspice.c b/src/sharedspice.c index ef913fca4..e7eacaca9 100644 --- a/src/sharedspice.c +++ b/src/sharedspice.c @@ -703,6 +703,8 @@ ngSpice_Init(SendChar* printfcn, SendStat* statusfcn, ControlledExit* ngspiceexi nobgtrwanted = TRUE; immediate = FALSE; + cp_nocc = TRUE; + #ifdef THREADS /* init the mutexes */ #ifdef HAVE_LIBPTHREAD From 3a73b4cf8fe68de0227afcad0a40971695e2b390 Mon Sep 17 00:00:00 2001 From: holger Date: Fri, 22 May 2020 14:20:12 +0200 Subject: [PATCH 2/2] If code completetion is deselected, don't add keywords or key commands. To prevent a crash in shared ngspice --- src/frontend/parser/complete.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/frontend/parser/complete.c b/src/frontend/parser/complete.c index 7264167b9..8dc8c2ff0 100644 --- a/src/frontend/parser/complete.c +++ b/src/frontend/parser/complete.c @@ -461,6 +461,9 @@ cp_addcomm(char *word, long int bits0, long int bits1, long int bits2, long int { struct ccom *cc; + if(cp_nocc) + return; + cc = clookup(word, &commands, FALSE, TRUE); cc->cc_invalid = 0; cc->cc_kwords[0] = bits0; @@ -490,6 +493,9 @@ cp_addkword(int kw_class, char *word) { struct ccom *cc; + if(cp_nocc) + return; + if ((kw_class < 1) || (kw_class >= NCLASSES)) { fprintf(cp_err, "cp_addkword: Internal Error: bad class %d\n", kw_class);