From 9ee57667486ec601e6f686cd178c1b8c704ac101 Mon Sep 17 00:00:00 2001 From: Andrey Gursky Date: Sat, 19 Dec 2015 03:59:01 +0100 Subject: [PATCH] Ticket #3577: Fix preallocation if appending during file copy The value of `ctx->do_append` is reset: appending = ctx->do_append; ctx->do_append = FALSE; Use `appending` in following conditionals instead. Signed-off-by: Yury V. Zaytsev --- src/filemanager/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/filemanager/file.c b/src/filemanager/file.c index c607d2e37..d42e85a80 100644 --- a/src/filemanager/file.c +++ b/src/filemanager/file.c @@ -1738,7 +1738,7 @@ copy_file_file (file_op_total_context_t * tctx, file_op_context_t * ctx, } /* try preallocate space; if fail, try copy anyway */ - while (vfs_preallocate (dest_desc, file_size, ctx->do_append != 0 ? sb.st_size : 0) != 0) + while (vfs_preallocate (dest_desc, file_size, appending ? sb.st_size : 0) != 0) { if (ctx->skip_all) { -- 2.11.4.GIT