From 0ab86ddaf0d0c28bdbae248f545474643f2609e2 Mon Sep 17 00:00:00 2001 From: rlar Date: Thu, 3 Oct 2013 11:54:58 +0200 Subject: [PATCH] inp_fix_ternary_operator_str(), abstraction, new function inp_search_opening_paren() --- src/frontend/inpcom.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 5eac18672..1c90a306e 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -1857,8 +1857,8 @@ inp_fix_ternary_operator_str(char *line, bool all) str_ptr2 = skip_back_ws(question); /* test for (conditional)?... */ if (str_ptr2[-1] == ')') { + char *inp_search_opening_paren(char *str_ptr, char *line) { int count = 1; - str_ptr = str_ptr2 - 1; while ((count != 0) && (str_ptr != line)) { str_ptr--; if (*str_ptr == '(') @@ -1866,6 +1866,9 @@ inp_fix_ternary_operator_str(char *line, bool all) if (*str_ptr == ')') count++; } + return str_ptr; + } + str_ptr = inp_search_opening_paren(str_ptr2 - 1, line); } /* test for (conditional?... */ else {