inpcom.c, inp_fix_ternary_operator_str(), rewrite

This commit is contained in:
rlar 2012-10-13 11:47:22 +02:00
parent 9352a4b72d
commit 680e45f7f3
1 changed files with 4 additions and 6 deletions

View File

@ -1756,13 +1756,11 @@ inp_fix_ternary_operator_str(char *line, bool all)
keep = *str_ptr2;
*str_ptr2 = '\0';
else_str = inp_fix_ternary_operator_str(strdup(str_ptr), all);
if (keep != '}') {
end_str = inp_fix_ternary_operator_str(strdup(str_ptr2+1), all);
} else {
*str_ptr2 = keep;
end_str = strdup(str_ptr2);
}
*str_ptr2 = keep;
if (keep != '}')
end_str = inp_fix_ternary_operator_str(strdup(str_ptr2+1), all);
else
end_str = strdup(str_ptr2);
} else {
if ((str_ptr2 = strstr(str_ptr, "}")) != NULL) {
*str_ptr2 = '\0';