Replace identifier by func not only after '=', but also '{'

Extension to commit
61e48f984 ("Start replacing identifiers by func only after the first '='", 2021-06-18)
This commit is contained in:
Holger Vogt 2021-06-18 17:48:00 +02:00
parent 68e51848a4
commit 87a9d87f7d
1 changed files with 11 additions and 2 deletions

View File

@ -7110,8 +7110,17 @@ static char *inp_functionalise_identifier(char *curr_line, char *identifier)
size_t len = strlen(identifier); size_t len = strlen(identifier);
char *p, *str = curr_line; char *p, *str = curr_line;
/* Start replacing identifier by func only after the first '=' */ /* Start replacing identifier by func only after the first '=' or '{' */
char* estr = strchr(curr_line, '='); char* estr1 = strchr(curr_line, '=');
char* estr2 = strchr(curr_line, '{');
char* estr;
if (estr1 && estr2)
estr = (estr1 < estr2) ? estr1 : estr2;
else if (estr1)
estr = estr1;
else
estr = estr2;
for (p = estr; (p = search_identifier(p, identifier, str)) != NULL;) for (p = estr; (p = search_identifier(p, identifier, str)) != NULL;)
if (p[len] != '(') { if (p[len] != '(') {