mirror of
https://git.code.sf.net/p/ngspice/ngspice
synced 2026-08-22 05:47:42 +02:00
inp.c, option handling debugged
This commit is contained in:
+7
-4
@@ -679,21 +679,24 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile)
|
|||||||
/* handle .if ... .elseif ... .else ... .endif statements. */
|
/* handle .if ... .elseif ... .else ... .endif statements. */
|
||||||
dotifeval(deck);
|
dotifeval(deck);
|
||||||
|
|
||||||
/* merge the two option line structs,
|
/* merge the two option line structs
|
||||||
keep com_options, options is loaded into circuit and freed
|
com_options (comfile == TRUE, filled in from spinit, .spiceinit, and *ng_sript), and
|
||||||
when circuit is removed */
|
options (comfile == FALSE, filled in from circuit with .OPTIONS)
|
||||||
|
into options, thus keeping com_options,
|
||||||
|
options is loaded into circuit and freed when circuit is removed */
|
||||||
if (!options && com_options)
|
if (!options && com_options)
|
||||||
options = inp_deckcopy(com_options);
|
options = inp_deckcopy(com_options);
|
||||||
else if (options && com_options) {
|
else if (options && com_options) {
|
||||||
/* move to end of copy from com_options and add options */
|
/* move to end of copy from com_options and add options */
|
||||||
struct line *tmp_options = inp_deckcopy(com_options);
|
struct line *tmp_options = inp_deckcopy(com_options);
|
||||||
|
struct line *new_options = tmp_options;
|
||||||
while (tmp_options) {
|
while (tmp_options) {
|
||||||
if (!tmp_options->li_next)
|
if (!tmp_options->li_next)
|
||||||
break;
|
break;
|
||||||
tmp_options = tmp_options->li_next;
|
tmp_options = tmp_options->li_next;
|
||||||
}
|
}
|
||||||
tmp_options->li_next = options;
|
tmp_options->li_next = options;
|
||||||
options = tmp_options;
|
options = new_options;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* prepare parse trees from 'temper' expressions */
|
/* prepare parse trees from 'temper' expressions */
|
||||||
|
|||||||
Reference in New Issue
Block a user