]> Sergey Matveev's repositories - nnn.git/commitdiff
When copying a single file sync cp file and cp buf
authorArun Prakash Jana <engineerarun@gmail.com>
Sat, 10 Nov 2018 23:13:27 +0000 (04:43 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Sat, 10 Nov 2018 23:30:37 +0000 (05:00 +0530)
src/nnn.c

index db2d693e113ffae0a6937c9f9ec422260f89b63e..ba8cef65c3bf166236a484c570300321586b566d 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -2975,6 +2975,10 @@ nochange:
                        } else if (cfg.quote) {
                                g_buf[0] = '\'';
                                r = mkpath(path, dents[cur].name, g_buf + 1, PATH_MAX);
+                               /* Keep the copy buf in sync */
+                               copybufpos = 0;
+                               appendfpath(g_buf + 1, r);
+
                                g_buf[r] = '\'';
                                g_buf[r + 1] = '\0';
 
@@ -2987,6 +2991,10 @@ nochange:
                                printmsg(g_buf + 1);
                        } else {
                                r = mkpath(path, dents[cur].name, newpath, PATH_MAX);
+                               /* Keep the copy buf in sync */
+                               copybufpos = 0;
+                               appendfpath(newpath, r);
+
                                if (!copier)
                                        writecp(newpath, r - 1); /* Truncate NULL from end */
                                else