From 87f53913bdb4627ee736166b31d5fd4f412696c3 Mon Sep 17 00:00:00 2001 From: rlar Date: Thu, 3 Oct 2013 11:54:58 +0200 Subject: [PATCH] inp_search_opening_paren(), cleanup --- src/frontend/inpcom.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 051f0351f..5bb221130 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -1808,18 +1808,19 @@ inp_search_closing_paren(char *s) /* search backwards for opening paren */ static char * -inp_search_opening_paren(char *str_ptr, char *line) +inp_search_opening_paren(char *s, char *start) { int count = 1; - // assert(*str_ptr == ')') - while ((count != 0) && (str_ptr != line)) { - str_ptr--; - if (*str_ptr == '(') + // assert(*s == ')') + while ((count != 0) && (s != start)) { + s--; + if (*s == '(') count--; - if (*str_ptr == ')') + if (*s == ')') count++; } - return str_ptr; + + return s; }