From 8c253524af3151d99d0da21901fefdfdffb9f002 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Thu, 10 Dec 2020 17:42:55 +0100 Subject: [PATCH] With the new inp_deckcopy_ln treat the first line in the deck equal to all other lines. --- src/frontend/subckt.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/frontend/subckt.c b/src/frontend/subckt.c index 51a233880..ffd851d08 100644 --- a/src/frontend/subckt.c +++ b/src/frontend/subckt.c @@ -887,7 +887,6 @@ struct card *inp_deckcopy_oc(struct card * deck) /* * Copy a deck, without the ->actualLine lines, without comment lines, and * without .control section(s). - * First line is always copied (except being .control). * Keep the line numbers. */ struct card* inp_deckcopy_ln(struct card* deck) @@ -911,6 +910,11 @@ struct card* inp_deckcopy_ln(struct card* deck) deck = deck->nextcard; continue; } + else if (*(deck->line) == '*') { + deck = deck->nextcard; + continue; + } + if (nd) { /* First card already found */ /* d is the card at the end of the deck */ d = d->nextcard = TMALLOC(struct card, 1); @@ -928,9 +932,6 @@ struct card* inp_deckcopy_ln(struct card* deck) } d->actualLine = NULL; deck = deck->nextcard; - while (deck && *(deck->line) == '*') { /* skip comments */ - deck = deck->nextcard; - } } /* end of loop over cards in the source deck */ return nd;