diff --git a/src/spicelib/parser/inp2q.c b/src/spicelib/parser/inp2q.c index fdf2955fe..4fb029db3 100644 --- a/src/spicelib/parser/inp2q.c +++ b/src/spicelib/parser/inp2q.c @@ -75,8 +75,6 @@ void INP2Q(CKTcircuit *ckt, INPtables * tab, card * current, CKTnode *gnode) thismodel = NULL; /* See if 4th token after device specification is a model name */ if (INPlookMod(model)) { - /* 3-terminal device - substrate to ground */ - node[3] = gnode; INPinsert(&model, tab); current->error = INPgetMod(ckt, model, &thismodel, tab); } else { @@ -111,6 +109,12 @@ void INP2Q(CKTcircuit *ckt, INPtables * tab, card * current, CKTnode *gnode) } } + if (i == 3) { + /* 3-terminal device - substrate to ground */ + node[3] = gnode; + nodeflag = 4; + } + #ifdef TRACE printf("INP2Q: Looking up model\n"); #endif