From 0a2e031cb1ae3c355c2118989a0e04d209c593a7 Mon Sep 17 00:00:00 2001 From: h_vogt Date: Sat, 24 Mar 2012 18:29:36 +0100 Subject: [PATCH] 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) --- src/frontend/inpcom.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 45c755dab..e1eab0247 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -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--;