From 680e45f7f3a0d7fa1684d6b71e755f6b84d76292 Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 13 Oct 2012 11:47:22 +0200 Subject: [PATCH] inpcom.c, inp_fix_ternary_operator_str(), rewrite --- src/frontend/inpcom.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 1f17051ec..094b5497c 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -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';