From f6d1f1fa73381b36814bd7e7c75b6df5585d15df Mon Sep 17 00:00:00 2001 From: rlar Date: Sun, 11 Mar 2012 21:55:42 +0100 Subject: [PATCH] nest, cleanup the loop, pronounce the `c', `lcc' pair --- src/frontend/subckt.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/frontend/subckt.c b/src/frontend/subckt.c index b522c9c41..bf3f2d3fd 100644 --- a/src/frontend/subckt.c +++ b/src/frontend/subckt.c @@ -447,7 +447,10 @@ doit(struct line *deck) { { int nest = 1; lcc = last; - for (c = last->li_next; c; c = c->li_next) { + c = lcc->li_next; + + while (c) { + if (ciprefix(sbend, c->li_line)) /* found a .ends */ nest--; else if (ciprefix(start, c->li_line)) /* found a .subckt */ @@ -456,7 +459,8 @@ doit(struct line *deck) { if(!nest) break; - lcc = c; /* lcc points to current pos of c */ + lcc = c; + c = lcc->li_next; } }