submod, drop renamed subname artifacts, EXACT

This commit is contained in:
rlar 2012-03-11 21:42:54 +01:00
parent 6bd39e1037
commit 536bf69a24
1 changed files with 10 additions and 10 deletions

View File

@ -404,7 +404,7 @@ doit(struct line *deck) {
/* Save all the old stuff... */
struct subs *subs = NULL;
wordlist *submod0 = NULL;
wordlist *submod = NULL;
#ifdef TRACE
/* SDB debug statement */
@ -437,8 +437,8 @@ doit(struct line *deck) {
fprintf(cp_err, "Error: no %s line.\n", sbend);
return (NULL);
}
wl_free(submod0);
submod0 = NULL;
wl_free(submod);
submod = NULL;
/* Here we loop through the deck looking for .subckt and .ends cards.
* At the end of this section, last will point to the location of the
@ -613,8 +613,8 @@ doit(struct line *deck) {
lcc = inp_deckcopy(sss->su_def);
/* Change the names of .models found in .subckts . . . */
if (modtranslate(lcc, scname, &submod0)) /* this translates the model name in the .model line */
devmodtranslate(lcc, scname, submod0); /* This translates the model name on all components in the deck */
if (modtranslate(lcc, scname, &submod)) /* this translates the model name in the .model line */
devmodtranslate(lcc, scname, submod); /* This translates the model name on all components in the deck */
{
char *s = sss->su_args;
@ -1659,7 +1659,7 @@ numdevs(char *s)
* otherwise.
*----------------------------------------------------------------------*/
static bool
modtranslate(struct line *deck, char *subname, wordlist **submod1)
modtranslate(struct line *deck, char *subname, wordlist **submod)
{
struct line *c;
char *buffer, *name, *t, model[4 * BSIZE_SP];
@ -1684,11 +1684,11 @@ modtranslate(struct line *deck, char *subname, wordlist **submod1)
tfree(name);
name = gettok(&t); /* name now holds model name */
wlsub = alloc(struct wordlist);
wlsub->wl_next = *submod1;
if (*submod1)
(*submod1)->wl_prev = wlsub;
wlsub->wl_next = *submod;
if (*submod)
(*submod)->wl_prev = wlsub;
/* here's where we insert the model name into the model name list */
*submod1 = wlsub;
*submod = wlsub;
wlsub->wl_word = name;
#ifdef TRACE
/* SDB debug statement */