]> Sergey Matveev's repositories - nnn.git/commitdiff
Restore check to prevent overwriting hovered file when archiving
authorArun Prakash Jana <engineerarun@gmail.com>
Mon, 12 Dec 2022 09:12:03 +0000 (14:42 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Mon, 12 Dec 2022 09:15:04 +0000 (14:45 +0530)
src/nnn.c

index d8a9f8c41ab61fcdd59b82ea92690426e6ab3387..f0189d19d61de89f351c523a8436dddf7548bea7 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -7610,6 +7610,9 @@ nochange:
 
                        switch (sel) {
                        case SEL_ARCHIVE:
+                               if (r == 'c' && strcmp(tmp, pdents[cur].name) == 0)
+                                       continue; /* Cannot overwrite the hovered file */
+
                                tmp = abspath(tmp, NULL, newpath);
                                if (!tmp)
                                        continue;