diff --git a/src/frontend/inp.c b/src/frontend/inp.c index 29323975b..ce2c2ec8c 100644 --- a/src/frontend/inp.c +++ b/src/frontend/inp.c @@ -721,7 +721,7 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile) ciprefix(".four", s) || eq(s, ".plot") || eq(s, ".print") || - eq(s, ".save") || +/* eq(s, ".save") || add .save only after subcircuit expansion */ eq(s, ".op") || ciprefix(".meas", s) || eq(s, ".tf")) { @@ -838,6 +838,15 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile) return 1; } + /* Scan the deck again, now also adding .save commands to wl_first */ + for (dd = deck->nextcard; dd; dd = dd->nextcard) { + char* curr_line = dd->line; + if (ciprefix(".save", curr_line)) { + wl_append_word(&wl_first, &end, copy(dd->line)); + *curr_line = '*'; + } + } + /* Now handle translation of spice2c6 POLYs. */ #ifdef XSPICE /* Translate all SPICE 2G6 polynomial type sources */ diff --git a/src/frontend/subckt.c b/src/frontend/subckt.c index 10d8163b9..793be2b37 100644 --- a/src/frontend/subckt.c +++ b/src/frontend/subckt.c @@ -1176,7 +1176,7 @@ translate(struct card *deck, char *formal, char *actual, char *scname, const cha switch (dev_type) { case '.': - if (ciprefix(".ic", s) || ciprefix(".nodeset", s)) { + if (ciprefix(".ic", s) || ciprefix(".nodeset", s) || ciprefix(".save", s)) { while ((paren_ptr = strchr(s, '(')) != NULL) { name = paren_ptr + 1;