* 4160_complete_all_files:
editor: completing from all open files.
editor: word completion: refactoring.
editor: word completion: refactoring.
Ticket #4160: mceditor: complete words from all open files.
(edit_collect_completion_from_one_buffer): new function. Main loop of
completion searching is here now.
(edit_collect_completions): use edit_collect_completion_from_one_buffer().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
(edit_collect_completions): return GQueue. Use GQueue inside.
Do not return an empty queue, create it if needed only.
(edit_complete_word_cmd): Use GQueue inside. Ged rid of limitation
of completions count. Rename variable.
(editcmd_dialog_completion_show): take GQueue. Rename and reorder
arguments.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Initial step: refactoring.
(edit_collect_completions_get_current_word): return GString. Get rid of
allocate and free an empty string, create string if needed instead.
Reduce variable scope.
(edit_collect_completions): related changes.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
(execute_menu_command): prepare terminal to run system() and restore
after.
(user_menu_cmd): fix comment.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
After 8857423e4e due to
using "file -z", zip archves w/o ".zip" file name extension
(i.e. "ff_ext.xpi", a Firefox extension) aren't handled
as zip archives.
misc/mc.ext.in: fix regular expression for zip format.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
(do_update_prompt): fix NULL dereference. In case of running mc
as standalone editor/viewer/diffviewer, the subshell_prompt variable
is NULL.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
If function failed, fail early.
Found by Coverity.
Coverity id #32538.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Statement cannot be true at this state.
Found by Coverity.
Coverity id #32572.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
...because the pointer can't be NULL.
Found by Coverity.
Coverity id #313667.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
...because the pointer can't be NULL.
Found by Coverity.
Coverity id #110817.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
...because the pointer can't be NULL.
Found by Coverity.
Coverity id #110819.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
If c_filesizes[0] is greater than 0x7fff implicit sign extension will happen on bit shift.
Found by Coverity.
Coverity id #32611.
Coverity id #32612.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Handle open failure properly.
Found by Coverity.
Coverity id #32608.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Save file handle for later close, if valid.
Found by Coverity.
Coverity id #32607.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Found by Coverity.
Coverity id #32627.
Coverity id #313665.
Covertiy id #313669.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>