From e41db66b6c0513867122bd320e3606b120bd9c55 Mon Sep 17 00:00:00 2001 From: rlar Date: Wed, 7 Mar 2012 20:43:07 +0100 Subject: [PATCH] nest, increment semantics of `nest' --- src/frontend/subckt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/frontend/subckt.c b/src/frontend/subckt.c index 1eae4f031..27e53ed8d 100644 --- a/src/frontend/subckt.c +++ b/src/frontend/subckt.c @@ -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 */ }