]> Sergey Matveev's repositories - nnn.git/commitdiff
Fix segfault when a non-matching filter is applied twice
authorlostd <lostd@2f30.org>
Tue, 27 Jan 2015 07:47:56 +0000 (09:47 +0200)
committerlostd <lostd@2f30.org>
Tue, 27 Jan 2015 07:47:56 +0000 (09:47 +0200)
noice.c

diff --git a/noice.c b/noice.c
index aa0e8723077621c0e53b52705021e4752fcd2e1c..bd35eaa6eb0087a71758d12c6a622a7a0281151c 100644 (file)
--- 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)