Ticket: 3908: quiet single file overwrite.

If target file exists, MC overwrites that file without confirmation.

The bug has not been fixed comletely in
7d73ce1cbe.

Yet another test case:

1. Create files:

    mkdir -p test1/1 test2/1
    echo "1" > test1/1/file
    echo "2" > test2/1/file

2. Run `mc test1 test2`.
3. Select directory "1" and press F6.

Result: "file" file is overwritten w/o confirmation.

Expected result: since the "file" file exists the confirmation dialog
must be shown.

The problem is: confirmation dialog requires context UI which was not
created in case of single directory move/rename operation.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2018-07-28 17:21:24 +03:00
parent 0bb1db9030
commit 7ac669c654
1 changed files with 4 additions and 6 deletions

View File

@ -1940,15 +1940,13 @@ operate_single_file (const WPanel * panel, FileOperation operation, file_op_tota
break;
case OP_MOVE:
if (is_file)
{
#ifdef ENABLE_BACKGROUND
/* create UI to show confirmation dialog */
if (!mc_global.we_are_background)
file_op_context_create_ui (ctx, TRUE, FILEGUI_DIALOG_ONE_ITEM);
/* create UI to show confirmation dialog */
if (!mc_global.we_are_background)
file_op_context_create_ui (ctx, TRUE, FILEGUI_DIALOG_ONE_ITEM);
#endif
if (is_file)
value = move_file_file (panel, tctx, ctx, src, dest);
}
else
value = do_move_dir_dir (panel, tctx, ctx, src, dest);
break;