From 797ce5fb21b6ff964fc058aecafd795df64ae830 Mon Sep 17 00:00:00 2001
From: Andrey Gursky <andrey.gursky@e-mail.ua>
Date: Sat, 19 Dec 2015 03:59:01 +0100
Subject: [PATCH 1/2] Fix preallocation if appending during file copy
ctx->do_append is reseted:
appending = ctx->do_append;
ctx->do_append = FALSE;
Use appending instead.
https://www.midnight-commander.org/ticket/3577
---
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 0bacc54..3aa84aa 100644
a
|
b
|
copy_file_file (file_op_total_context_t * tctx, file_op_context_t * ctx, |
1738 | 1738 | } |
1739 | 1739 | |
1740 | 1740 | /* try preallocate space; if fail, try copy anyway */ |
1741 | | while (vfs_preallocate (dest_desc, file_size, ctx->do_append != 0 ? sb.st_size : 0) != 0) |
| 1741 | while (vfs_preallocate (dest_desc, file_size, appending ? sb.st_size : 0) != 0) |
1742 | 1742 | { |
1743 | 1743 | if (ctx->skip_all) |
1744 | 1744 | { |