nest, increment semantics of `nest'

This commit is contained in:
rlar 2012-03-07 20:43:07 +01:00
parent 4af931d9e4
commit e41db66b6c
1 changed files with 2 additions and 3 deletions

View File

@ -446,13 +446,12 @@ doit(struct line *deck) {
* .subckt card, and lcc will point to the location of the .ends card.
*/
{
int nest = 0;
int nest = 1;
for (c = last->li_next; c; c = c->li_next) {
if (ciprefix(sbend, c->li_line)) { /* found a .ends */
if (!nest)
if (!--nest)
break; /* nest = 0 means we have balanced .subckt and .ends */
else {
nest--; /* decrement nesting, and assign lcc to the current card */
lcc = c; /* (lcc points to the position of the .ends) */
continue; /* then continue looping */
}