From 20d651f00cc41e9e8f122abe03fa32d398005419 Mon Sep 17 00:00:00 2001 From: rlar Date: Thu, 15 May 2014 18:40:13 +0200 Subject: [PATCH] subckt.c, #5/5 local scope for orig_modnames --- src/frontend/subckt.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/frontend/subckt.c b/src/frontend/subckt.c index 1c5b380c1..0714f2776 100644 --- a/src/frontend/subckt.c +++ b/src/frontend/subckt.c @@ -397,7 +397,6 @@ doit(struct line *deck, wordlist *modnames) { /* Save all the old stuff... */ struct subs *subs = NULL; - wordlist *orig_modnames; wordlist *xmodnames = modnames; #ifdef TRACE @@ -607,11 +606,16 @@ doit(struct line *deck, wordlist *modnames) { lcc = inp_deckcopy(sss->su_def); /* Change the names of .models found in .subckts . . . */ - /* this translates the model name in the .model line */ - orig_modnames = modtranslate(lcc, scname, &modnames); - if (orig_modnames) - devmodtranslate(lcc, scname, orig_modnames); /* This translates the model name on all components in the deck */ - wl_free(orig_modnames); + { + /* this translates the model names in .model lines + * and appends them to `modnames' + */ + wordlist *orig_modnames = modtranslate(lcc, scname, &modnames); + /* This translates the model name on all components in the deck */ + if (orig_modnames) + devmodtranslate(lcc, scname, orig_modnames); + wl_free(orig_modnames); + } { char *s = sss->su_args;