bug fix, inp_fix_subckt(): problem when parsing a .subckt line

this worked
  .subckt psub a b p2 = {p1*2-1} p1 = 1
but this failed
  .subckt psub a b p2 = { p1 * 2 - 1 }  p1 = 1

thanks to Ivan Riis Nielsen for the report in Message
  [Ngspice-devel] parsing problem (ngspice-24 tarball)
This commit is contained in:
h_vogt 2012-03-24 18:29:36 +01:00
parent 4b1abe0a18
commit 0a2e031cb1
1 changed files with 3 additions and 2 deletions

View File

@ -1949,8 +1949,9 @@ inp_fix_subckt( char *s )
head = alloc(struct line);
/* create list of parameters that need to get sorted */
while ( *beg && (ptr1 = strstr( beg, "=" )) != NULL ) {
#ifdef BRACE
/* alternative patch to cope with spaces */
#ifndef NOBRACE
/* alternative patch to cope with spaces:
get expression between braces {...} */
ptr2 = ptr1+1;
ptr1--;
while ( isspace(*ptr1) ) ptr1--;