If code completetion is deselected, don't add keywords or key commands.
To prevent a crash in shared ngspice
This commit is contained in:
parent
061e48253b
commit
569bc228fd
|
|
@ -461,6 +461,9 @@ cp_addcomm(char *word, long int bits0, long int bits1, long int bits2, long int
|
||||||
{
|
{
|
||||||
struct ccom *cc;
|
struct ccom *cc;
|
||||||
|
|
||||||
|
if(cp_nocc)
|
||||||
|
return;
|
||||||
|
|
||||||
cc = clookup(word, &commands, FALSE, TRUE);
|
cc = clookup(word, &commands, FALSE, TRUE);
|
||||||
cc->cc_invalid = 0;
|
cc->cc_invalid = 0;
|
||||||
cc->cc_kwords[0] = bits0;
|
cc->cc_kwords[0] = bits0;
|
||||||
|
|
@ -490,6 +493,9 @@ cp_addkword(int kw_class, char *word)
|
||||||
{
|
{
|
||||||
struct ccom *cc;
|
struct ccom *cc;
|
||||||
|
|
||||||
|
if(cp_nocc)
|
||||||
|
return;
|
||||||
|
|
||||||
if ((kw_class < 1) || (kw_class >= NCLASSES)) {
|
if ((kw_class < 1) || (kw_class >= NCLASSES)) {
|
||||||
fprintf(cp_err, "cp_addkword: Internal Error: bad class %d\n",
|
fprintf(cp_err, "cp_addkword: Internal Error: bad class %d\n",
|
||||||
kw_class);
|
kw_class);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue