aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nnn.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/nnn.c b/src/nnn.c
index e1a8c11..a80848e 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -3973,11 +3973,14 @@ nochange:
if (!ncp)
writecp(NULL, 0);
- r = mkpath(path, dents[cur].name, newpath);
- appendfpath(newpath, r);
+ /* Do not select if already selected */
+ if (!(dents[cur].flags & FILE_COPIED)) {
+ r = mkpath(path, dents[cur].name, newpath);
+ appendfpath(newpath, r);
- ++ncp;
- dents[cur].flags |= FILE_COPIED;
+ ++ncp;
+ dents[cur].flags |= FILE_COPIED;
+ }
/* move cursor to the next entry if this is not the last entry */
if (cur != ndents - 1)