quick.c:432:28: runtime error: member access within null pointer of type 'Widget' (aka 'struct Widget')
#0 in quick_dialog_skip lib/widget/quick.c:432:28
#1 in file_mask_dialog src/filemanager/filegui.c:1462:19
#2 in do_confirm_copy_move src/filemanager/file.c:1977:11
#3 in panel_operate src/filemanager/file.c:3536:16
#4 in copy_cmd src/filemanager/./cmd.h:111:5
#5 in midnight_execute_cmd src/filemanager/filemanager.c:1177:9
#6 in midnight_callback src/filemanager/filemanager.c
#7 in send_message lib/widget/../../lib/widget/widget-common.h:255:15
#8 in buttonbar_call lib/widget/buttonbar.c:157:15
#9 in buttonbar_callback lib/widget/buttonbar.c:174:42
#10 in send_message lib/widget/../../lib/widget/widget-common.h:255:15
#11 in group_handle_hotkey lib/widget/group.c:566:23
#12 in group_default_callback lib/widget/group.c:640:16
#13 in dlg_default_callback lib/widget/dialog.c:370:16
#14 in midnight_callback src/filemanager/filemanager.c:1615:16
#15 in send_message lib/widget/../../lib/widget/widget-common.h:255:15
#16 in group_handle_key lib/widget/group.c:503:15
#17 in group_default_callback lib/widget/group.c:637:16
#18 in dlg_key_event lib/widget/dialog.c:252:19
#19 in dlg_process_event lib/widget/dialog.c:539:9
#20 in frontend_dlg_run lib/widget/dialog.c:321:9
#21 in dlg_run lib/widget/dialog.c:573:5
#22 in do_nc src/filemanager/filemanager.c:1826:16
#23 in main src/main.c:469:21
#24 in <null> <null>
#25 in __libc_start_main <null>
#26 in _start <null>
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior quick.c:432:28.
Found by Clang-19 Static Analyzer.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Make Static Analyzer happy.
Bug Group Bug Type File Function/Method Line
Logic error Garbage return value src/filemanager/boxes.c cd_box 1236
Logic error Garbage return value lib/widget/wtools.c fg_input_dialog_help 198
Found by Clang-19 Static Analyzer.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
* (bg_message): use query_dialog() instead of fg_message().
* (message): likewise.
* (fg_message): isn't used anymore. Remove.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
* (vfs_dirent_assign): set d_len up.
* (mc_readdir): sync with new vfs_dirent: use d_len member.
* (filename_completion_function): likewise.
* (handle_dirent): likewise.
* (find_ignore_dir_search): add 2nd argument to use length of
directory name if it's known.
* (do_search): sync with modified vfs_dirent and find_ignore_dir_search().
* (NLENGTH): remove.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Add new item to a listbox taking ownerhip of item text
and avoid a string duplication.
(listbox_add_item): reimplement using listbox_add_item_take().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Steps to reproduce:
1. Create file owth a space in the name:
touch "a b"
There should no other files with name begins with "a" in the directory.
2. Press Shift-F4 to open editor
3. Press Shift-F2 to display dialog window "Save as..."
4. Press Esc+Tab to fill an input line
Result:
a\ b will appear in the edit field.
If you attempt to save the file, the back slash will be in the filename.
Expected result:
no any extra back slashes in the file name.
Soution: escape only '?', '*', and '&' symbols as described in the
manual page (see a11995e12b).
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
* (simple_status_msg_init_cb): pass NULL instead of "" to label_new()
to get rid of an empty string duplication.
* (advanced_chown_dlg_create): likewise.
* (chown_dlg_create): likewise.
* (dirsize_status_init_cb): likewise.
* (file_op_context_create_ui): likewise.
* (setup_gui): likewise.
* (init_hotlist): likewise.
* (init_learn): likewise.
* (file_progress_show_source): pass NULL instead of "" to
label_set_text() to get rid of an empty string duplication.
* (file_progress_show_target): likewise.
* (create_file_manager): pass NULL instead of 0 to label_new().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Found via `codespell -S
po,doc,./misc/syntax,./src/vfs/extfs/helpers/README.it -L
parm,rouge,sav,ect,vie,te,dum,clen,wee,dynamc,childs,ths,fo,nin,unx,nd,iif,iterm,ser,makrs,wil`
Co-authored-by: Yury V. Zaytsev <yury@shurup.com>
Signed-off-by: Kian-Meng Ang <kianmeng@cpan.org>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
../../../lib/widget/input.c:573:8: error: 'event_data.ret' may be used uninitialized [-Werror=maybe-uninitialized]
573 | if (event_data.ret)
| ^
../../../lib/widget/input.c:566:35: note: 'event_data.ret' was declared here
566 | ev_clipboard_text_from_file_t event_data;
Found by gcc-11.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Use it instead of direct access to WInput's buffer.
(handle_cmdline_enter): additional minor refactoring.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>