diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 61c73e7b7..342675754 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -1657,13 +1657,6 @@ inp_fix_ternary_operator_str(char *line, bool all) str_ptr = skip_ws(str_ptr + 1); if (*str_ptr == '{') str_ptr = skip_ws(str_ptr + 1); - - question = strchr(str_ptr, '?'); - paren_ptr = strchr(str_ptr, '('); - - if (paren_ptr && paren_ptr < question) - paren_ptr = NULL; - } else { return line; } @@ -1733,7 +1726,8 @@ inp_fix_ternary_operator_str(char *line, bool all) // get else str_ptr = skip_ws(colon + 1); - if (paren_ptr != NULL) { + paren_ptr = strchr(question, '('); + if (paren_ptr) { // find end paren ')' bool found_paren = FALSE; count = 0;