nest, rewrite

This commit is contained in:
rlar 2012-03-07 20:48:01 +01:00
parent c86d52aab6
commit b8b1c9dc6a
1 changed files with 4 additions and 3 deletions

View File

@ -448,15 +448,16 @@ doit(struct line *deck) {
{ {
int nest = 1; int nest = 1;
for (c = last->li_next; c; c = c->li_next) { 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--; nest--;
} else if (ciprefix(start, c->li_line)) /* if .subckt, increment nesting */ else if (ciprefix(start, c->li_line)) /* found a .subckt */
nest++; nest++;
if(!nest) if(!nest)
break; break;
lcc = c; /* lcc points to current pos of c */ 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 */ /* Check to see if we have looped through remainder of deck without finding .ends */