]> Sergey Matveev's repositories - nnn.git/commitdiff
Fix #188
authorArun Prakash Jana <engineerarun@gmail.com>
Fri, 11 Jan 2019 02:36:16 +0000 (08:06 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Fri, 11 Jan 2019 02:36:16 +0000 (08:06 +0530)
src/nnn.c

index 2e5f8a09b194ce1caa83cdaeb954cfb25b75743d..50c9b9de2bc3b9d501b678659fb45480e066c995 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -3045,7 +3045,8 @@ nochange:
                case SEL_HELP: // fallthrough
                case SEL_LOCK:
                {
-                       mkpath(path, dents[cur].name, newpath, PATH_MAX);
+                       if (ndents)
+                               mkpath(path, dents[cur].name, newpath, PATH_MAX);
 
                        switch (sel) {
                        case SEL_MEDIA:
@@ -3097,7 +3098,8 @@ nochange:
                                presel = FILTER;
 
                        /* Save current */
-                       copycurname();
+                       if (ndents)
+                               copycurname();
 
                        /* Repopulate as directory content may have changed */
                        goto begin;
@@ -3251,7 +3253,8 @@ nochange:
 
                        spawn("sh", "-c", g_buf, path, F_NORMAL | F_SIGINT);
 
-                       copycurname();
+                       if (ndents)
+                               copycurname();
                        if (cfg.filtermode)
                                presel = FILTER;
                        goto begin;