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