From 0071ad856946e63605a2585c53d58ab78bee2b31 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Fri, 6 Sep 2019 22:48:23 +0200 Subject: [PATCH] If a subcircuit is defined more than once, only read the first one, rename the others und thus discard them. --- src/frontend/inpcom.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index c2c58dae2..e20f7987a 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -8179,8 +8179,9 @@ static void add_subckt(struct nscope *scope, struct card *subckt_line) char *n = skip_ws(skip_non_ws(subckt_line->line)); char *name = copy_substring(n, skip_non_ws(n)); if (find_subckt_1(scope, name)) { - fprintf(stderr, "redefinition of .subckt %s\n", name); - controlled_exit(1); + fprintf(stderr, "Warning: redefinition of .subckt %s, ignored\n", name); + /* rename the redefined subcircuit */ + *n = '_'; } struct card_assoc *entry = TMALLOC(struct card_assoc, 1); entry->name = name;