diff --git a/ChangeLog b/ChangeLog index 9c64c69c8..54f37924d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-07-27 Robert Larice + * inpcom.c: nested parens, line 2963 ff + * cmutil.c: inlude ngspice.h for NaN + 2011-07-26 Robert Larice * src/spicelib/devices/adms/admst/ngspice.xml : lower-case the first string in an IOP("HuGo",...) incantation diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index c085cdabe..7c71bddb2 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -2780,8 +2780,9 @@ inp_fix_param_values( struct line *deck ) struct line *c = deck; char *line, *beg_of_str, *end_of_str, *old_str, *equal_ptr, *new_str; char *vec_str, *natok, *buffer, *newvec, *whereisgt; - bool control_section = FALSE, has_paren = FALSE; + bool control_section = FALSE; wordlist *wl, *nwl; + int parens; while ( c != NULL ) { line = c->li_line; @@ -2957,9 +2958,10 @@ inp_fix_param_values( struct line *deck ) } else { /* put {} around token to be accepted as numparam */ end_of_str = beg_of_str; - while ( *end_of_str != '\0' && (!isspace(*end_of_str) || has_paren) ) { - if ( *end_of_str == '(' ) has_paren = TRUE; - if ( *end_of_str == ')' ) has_paren = FALSE; + parens = 0; + while ( *end_of_str != '\0' && (!isspace(*end_of_str) || (parens > 0)) ) { + if ( *end_of_str == '(' ) parens++; + if ( *end_of_str == ')' ) parens--; end_of_str++; } diff --git a/src/xspice/cm/cmutil.c b/src/xspice/cm/cmutil.c index 61f65b6fd..3d9531523 100755 --- a/src/xspice/cm/cmutil.c +++ b/src/xspice/cm/cmutil.c @@ -51,6 +51,7 @@ NON-STANDARD FEATURES #include #include #include "cm.h" +#include "ngspice.h" /* for NaN */ /* Corner Smoothing Function ************************************ * *