From f8a06900c286a4da7a05e1a024d5e0385015fe3c Mon Sep 17 00:00:00 2001 From: rlar Date: Thu, 3 Oct 2013 11:54:58 +0200 Subject: [PATCH] inp_search_closing_paren(), cleanup --- src/frontend/inpcom.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index b70b7fe96..0df6c8f1f 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -1792,12 +1792,14 @@ inp_search_closing_paren1(char *s) { int count = 1; // assert(*s == '(') - while (count != 0 && *s != '\0') { + while (*s != '\0') { s++; if (*s == '(') count++; if (*s == ')') count--; + if (count == 0) + break; } if (count != 0) return NULL;