diff --git a/src/frontend/options.c b/src/frontend/options.c index a9e831fa3..5aa3d9ecf 100644 --- a/src/frontend/options.c +++ b/src/frontend/options.c @@ -161,27 +161,25 @@ inp_getopts(struct line *deck) } -/* Extract the option lines from a comfile (spinit, .spiceinit) */ +/* copy the given option line, + * (presumably from a comfile, e.g. spinit or .spiceinit) + * substitute '.options' for 'option' + * then put it in front of the given 'options' list */ + struct line * -inp_getoptsc(char *in_line, struct line *com_options) +inp_getoptsc(char *line, struct line *options) { - struct line *next = NULL; - char *line; + gettok_nc(&line); /* skip option */ - /* option -> .options */ - /* skip option */ - gettok_nc(&in_line); - line = tprintf(".options %s", in_line); + struct line *next = TMALLOC(struct line, 1); - next = TMALLOC(struct line, 1); - next->li_line = line; + next->li_line = tprintf(".options %s", line); next->li_linenum = 0; next->li_error = NULL; next->li_actual = NULL; /* put new line in front */ - if (com_options) - next->li_next = com_options; + next->li_next = options; return next; } diff --git a/src/include/ngspice/fteext.h b/src/include/ngspice/fteext.h index b59149c13..14b564827 100644 --- a/src/include/ngspice/fteext.h +++ b/src/include/ngspice/fteext.h @@ -251,7 +251,7 @@ extern bool ft_controldb; extern bool ft_asyncdb; extern char *ft_setkwords[]; extern struct line *inp_getopts(struct line *deck); -extern struct line *inp_getoptsc(char *in_line, struct line *com_options); +extern struct line *inp_getoptsc(char *line, struct line *options); extern bool ft_ngdebug; extern bool ft_stricterror;