aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar lostd <lostd@2f30.org>2015-01-27 09:47:56 +0200
committerGravatar lostd <lostd@2f30.org>2015-01-27 09:47:56 +0200
commit9679e132d48dc6e39e3e4e0798aed75696784ba3 (patch)
treee889372b5662326ec197b0c99105bb788f1ea614
parent892c7c850a27331f6debb0d5968282d0e3278592 (diff)
downloadnnn-9679e132d48dc6e39e3e4e0798aed75696784ba3.tar.gz
Fix segfault when a non-matching filter is applied twice
-rw-r--r--noice.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/noice.c b/noice.c
index aa0e872..bd35eaa 100644
--- a/noice.c
+++ b/noice.c
@@ -678,7 +678,8 @@ nochange:
filter_re = re;
DPRINTF_S(filter);
/* Save current */
- oldpath = makepath(path, dents[cur].name);
+ if (n > 0)
+ oldpath = makepath(path, dents[cur].name);
goto out;
case SEL_NEXT:
if (cur < n - 1)