parameter without curly braces in subckt definition

This commit is contained in:
dwarning 2009-12-06 18:30:59 +00:00
parent 40de598586
commit 3de58ec504
1 changed files with 28 additions and 25 deletions

View File

@ -2994,7 +2994,7 @@ static void
inp_sort_params( struct line *start_card, struct line *end_card, struct line *card_bf_start, struct line *s_c, struct line *e_c ) inp_sort_params( struct line *start_card, struct line *end_card, struct line *card_bf_start, struct line *s_c, struct line *e_c )
{ {
char *param_name = NULL, *param_str = NULL, *param_ptr = NULL; char *param_name = NULL, *param_str = NULL, *param_ptr = NULL;
int i, j, num_params = 0, ind = 0, max_level = 0, num_terminals = 0; int i, j, num_params = 0, ind = 0, max_level = 0, num_terminals = 0, ioff = 1;
bool in_control = FALSE; bool in_control = FALSE;
bool found_in_list = FALSE; bool found_in_list = FALSE;
@ -3087,8 +3087,11 @@ inp_sort_params( struct line *start_card, struct line *end_card, struct line *ca
while ( ( param_ptr = strstr( param_str, param_name ) ) ) while ( ( param_ptr = strstr( param_str, param_name ) ) )
{ {
if ( !isalnum( *(param_ptr-1) ) && *(param_ptr-1) != '_' && ioff = (strstr(param_ptr, "}") > 0 ? 1 : 0); /* want prevent wrong memory access below */
/* looking for curly braces or other string limiter */
if ( ( !isalnum( *(param_ptr-ioff) ) && *(param_ptr-ioff) != '_' &&
!isalnum( *(param_ptr+strlen(param_name)) ) && *(param_ptr+strlen(param_name)) != '_' ) !isalnum( *(param_ptr+strlen(param_name)) ) && *(param_ptr+strlen(param_name)) != '_' )
|| strcmp( param_ptr, param_name ) == 0) /* this are cases without curly braces */
{ {
ind = 0; ind = 0;
found_in_list = FALSE; found_in_list = FALSE;