If target file exists, MC overwrites that file without confirmation.
The bug was introduced in #3149.
How to reproduce:
1. Create two files: `touch a aa`.
2. Stay on "aa".
3. Make sure that Options/Confirmation.../Overwrite option is checked on.
4. Press Shift-F6
5. Edit the "to:" value to "a" ("a" file exists) and press Enter.
Actual result:
The "a" file is overwritten w/o confirmation.
Expected result:
Since the "a" file exists the confirmation dialog must be shown.
The problem is: confirmation dialog requires context UI which was not
created in case of single file rename operation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
(edit_quit): do not call widget_select() while direct iterating editor
windows because it changes the window position in Z order. Collect
modified files in separate list.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
* 3876_cleanup: (47 commits)
(mc_deserialize_str): trivial optimization.
(edit_do_search): use gboolean. Remove unused computations.
(str_8bit_encodings[], str_utf8_encodings[]): make const.
(etags_set_definition_hash): make buf stack variable.
(convert_from_8bit_to_utf_c2): use convert_from_8bit_to_utf_c().
str_convert_to_input() never returns NULL.
(edit_collect_completions): str_convert_to_display() never returns NULL.
lib/charsets.c: fix coding style, trivial optimizations.
(mc_search__recode_str): minor optimization.
(mc_search__get_one_symbol): cosmetics.
strutil: character test functions return gboolean instead of int.
Use str_move() where possible.
Use gboolean instead of int in file/dir sort related functions.
(get_codepage_index): minor optimizations.
(ftpfs_command): minor optimization.
FTP: fix some calls of ftpfs_command().
FISH: optimize creation of FISH commands.
src/vfs/fish/fish.c: allocate buffer for command dynamically.
(vfs_url_split): Fix 2 memory leaks found by valgrind.
smbfs: code cleanup
...
* (create_panels_and_run_mc): rename to create_file_manager.
Move call of dlg_run() to do_nc().
* (create_panels): create file panels only. Move creation of
other widgets to create_file_manager().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Found by Clang 4.0.1.
edit.c:896:16: error: 'return' will never be executed [-Werror,-Wunreachable-code-return]
return 0x80000000UL;
^~~~~~~~~~~~
(whole my_type_of() is suspect)
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Found by GCC 6.4.0.
panel.c: In function 'panel_reload':
panel.c:4188:40: warning: potential null pointer dereference [-Wnull-dereference]
if (IS_PATH_SEP (panel_cwd_path[0]) && panel_cwd_path[1] == '\0')
../../lib/global.h:132:26: note: in definition of macro 'IS_PATH_SEP'
#define IS_PATH_SEP(c) ((c) == PATH_SEP)
^
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Found by GCC 7.2.0
utilunix.c: In function 'my_systemv':
utilunix.c:455:13: error: this statement may fall through [-Werror=implicit-fallthrough=]
my_exit (127); /* Exec error */
^~~~~~~~~~~~~
utilunix.c:458:5: note: here
default:
^~~~~~~
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>