inp2q.c, #16/23, emit a message and give up, if we couldn't find the modelname token
Thats a functional change of ngspice. So far we did cook up a "default" model when we didn't find a model token. But this was buggy anyway, because in such cases we silently dropped a token from beeing processed by PARSECALL() Now, we emit a message, and skip this line alltogether.
This commit is contained in:
parent
83fb9353ef
commit
03d3e2ea12
|
|
@ -69,6 +69,8 @@ void INP2Q(CKTcircuit *ckt, INPtables * tab, card * current, CKTnode *gnode)
|
|||
INPtermInsert(ckt, &nname[i], tab, &node[i]);
|
||||
}
|
||||
|
||||
model = NULL;
|
||||
|
||||
i = 3;
|
||||
INPgetTok(&line, &nname[i], 1);
|
||||
|
||||
|
|
@ -91,13 +93,20 @@ void INP2Q(CKTcircuit *ckt, INPtables * tab, card * current, CKTnode *gnode)
|
|||
INPtermInsert(ckt, &nname[i], tab, &node[i]);
|
||||
i = 5;
|
||||
INPgetTok(&line, &nname[i], 1);
|
||||
model = nname[i];
|
||||
INPinsert(&model, tab);
|
||||
current->error = INPgetMod(ckt, model, &thismodel, tab);
|
||||
if (INPlookMod(nname[i])) {
|
||||
model = nname[i];
|
||||
INPinsert(&model, tab);
|
||||
current->error = INPgetMod(ckt, model, &thismodel, tab);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
if (!model) {
|
||||
LITERR ("could not find a valid modelname");
|
||||
return;
|
||||
}
|
||||
|
||||
if (i == 3) {
|
||||
/* 3-terminal device - substrate to ground */
|
||||
node[3] = gnode;
|
||||
|
|
|
|||
Loading…
Reference in New Issue