If the --partial-dir value is an absolute path and we use a file in
authorWayne Davison <wayned@samba.org>
Tue, 9 May 2006 17:38:47 +0000 (17:38 +0000)
committerWayne Davison <wayned@samba.org>
Tue, 9 May 2006 17:38:47 +0000 (17:38 +0000)
it as an alternate basis file, make sure that we delete it when the
associated destination file is successfully updated.

receiver.c

index 26be6f55942f09da20633db2f6cecb5838dfe073..b6215fb34e310f5ecf5e95a33bbae252aa8bb107 100644 (file)
@@ -617,9 +617,14 @@ int recv_files(int f_in, struct file_list *flist, char *local_name)
                }
 
                if ((recv_ok && (!delay_updates || !partialptr)) || inplace) {
-                       if (partialptr == fname || *partial_dir == '/')
-                               partialptr = NULL;
-                       finish_transfer(fname, fnametmp, partialptr,
+                       char *temp_copy_name;
+                       if (partialptr == fname)
+                               partialptr = temp_copy_name = NULL;
+                       else if (*partial_dir == '/')
+                               temp_copy_name = NULL;
+                       else
+                               temp_copy_name = partialptr;
+                       finish_transfer(fname, fnametmp, temp_copy_name,
                                        file, recv_ok, 1);
                        if (fnamecmp == partialptr) {
                                do_unlink(partialptr);