diff --git a/ChangeLog b/ChangeLog index 6ecddef9a..1f22dab75 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,13 @@ +2011-07-17 Holger Vogt + * inp.c: allow comment lines inside of + command files + 2011-07-17 Robert Larice * src/include/hash.h , * src/misc/hash.c : nghash cleanup -2011-07-18 Holger Vogt +2011-07-17 Holger Vogt * cmath1.c, cmath1.h, cmath2.c, cmath2.h, parse.c, fteext.h: new complex functions sinh, cosh, tanh * evaluate.c: remove redundant call to cmath2.h diff --git a/src/frontend/inp.c b/src/frontend/inp.c index 4e32c67dd..cca6669ef 100644 --- a/src/frontend/inp.c +++ b/src/frontend/inp.c @@ -401,12 +401,20 @@ inp_spsource(FILE *fp, bool comfile, char *filename) } temperature = strdup(s); } - /* Ignore comment lines, but not lines begining with '*#' */ + /* Ignore comment lines, but not lines begining with '*#', + but remove them, if they are in a .control ... .endc section */ s = dd->li_line; while(isspace(*s)) s++; if ( (*s == '*') && ( (s != dd->li_line) || (s[1] != '#'))) { - ld = dd; - continue; + if (commands) { + /* Remove comment lines in control sections, so they don't + * get considered as circuits. */ + ld->li_next = dd->li_next; + line_free(dd,FALSE); + continue; + } + ld = dd; + continue; } /* Put the first token from line into s */