From b8b1c9dc6a5bb3bacd24023474fb0dc0b022c9dc Mon Sep 17 00:00:00 2001 From: rlar Date: Wed, 7 Mar 2012 20:48:01 +0100 Subject: [PATCH] nest, rewrite --- src/frontend/subckt.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/frontend/subckt.c b/src/frontend/subckt.c index 6a48088e8..b27e27676 100644 --- a/src/frontend/subckt.c +++ b/src/frontend/subckt.c @@ -448,15 +448,16 @@ doit(struct line *deck) { { int nest = 1; for (c = last->li_next; c; c = c->li_next) { - if (ciprefix(sbend, c->li_line)) { /* found a .ends */ + if (ciprefix(sbend, c->li_line)) /* found a .ends */ nest--; - } else if (ciprefix(start, c->li_line)) /* if .subckt, increment nesting */ + else if (ciprefix(start, c->li_line)) /* found a .subckt */ nest++; if(!nest) break; + lcc = c; /* lcc points to current pos of c */ - } /* for (nest = 0 . . . */ + } } /* Check to see if we have looped through remainder of deck without finding .ends */