diff --git a/src/filemanager/file.c b/src/filemanager/file.c index 8a572fc43..f7f07960c 100644 --- a/src/filemanager/file.c +++ b/src/filemanager/file.c @@ -2274,8 +2274,12 @@ copy_file_file (file_op_total_context_t *tctx, file_op_context_t *ctx, vfs_path_t *src_vpath = NULL, *dst_vpath = NULL; char *buf = NULL; - /* FIXME: We should not be using global variables! */ - ctx->do_reget = 0; + /* Keep the non-default value applied in chain of calls: + move_file_file() -> file_progress_real_query_replace() + move_file_file() -> copy_file_file() */ + if (ctx->do_reget < 0) + ctx->do_reget = 0; + return_status = FILE_RETRY; dst_vpath = vfs_path_from_str (dst_path); diff --git a/src/filemanager/filegui.c b/src/filemanager/filegui.c index 736af9ae7..08f94d97e 100644 --- a/src/filemanager/filegui.c +++ b/src/filemanager/filegui.c @@ -569,7 +569,7 @@ overwrite_query_dialog (file_op_context_t *ctx, enum OperationMode mode) /* will "Append" and "Reget" buttons be in the dialog? */ do_append = !S_ISDIR (ui->dst_stat->st_mode); - do_reget = do_append && ctx->operation == OP_COPY && ui->dst_stat->st_size != 0 + do_reget = do_append && ui->dst_stat->st_size != 0 && ui->src_stat->st_size > ui->dst_stat->st_size; NEW_LABEL (8, dlg_widgets[8].text); diff --git a/src/filemanager/fileopctx.c b/src/filemanager/fileopctx.c index 62d76ae70..1f32664cd 100644 --- a/src/filemanager/fileopctx.c +++ b/src/filemanager/fileopctx.c @@ -74,7 +74,7 @@ file_op_context_new (FileOperation op) ctx->operation = op; ctx->eta_secs = 0.0; ctx->progress_bytes = 0; - ctx->do_reget = 1; + ctx->do_reget = -1; ctx->stat_func = mc_lstat; ctx->preserve = TRUE; ctx->preserve_uidgid = (geteuid () == 0);