From ab0c9e592146fefe4298cdc3e061bfb8f8a8fb1f Mon Sep 17 00:00:00 2001 From: lostd Date: Tue, 27 Jan 2015 14:38:37 +0200 Subject: [PATCH] Keep last valid state on regex errors --- noice.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/noice.c b/noice.c index af9a34d6..85ec3d73 100644 --- a/noice.c +++ b/noice.c @@ -749,8 +749,13 @@ moretyping: /* Check regex errors */ if (tmp != NULL) r = setfilter(&re, tmp); - if (r != 0 && nowtyping) - goto moretyping; + if (r != 0) + if (nowtyping) { + goto moretyping; + } else { + free(tmp); + goto nochange; + } /* Copy or reset filter */ free(filter); if (tmp != NULL)