Commit Graph

14927 Commits

Author SHA1 Message Date
Andrew Borodin
ba62dd32ad Ticket #4181: FTBFS against NCurses on OS X 10.9.5.
lib/tty/tty-ncurses.h: define _XOPEN_SOURCE_EXTENDED to use cchar_t,
getcchar(), setcchar().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-01-24 14:19:22 +03:00
Andrew Borodin
a75071b3c0 Merge branch '4180_mc.ext_zip_regex'
* 4180_mc.ext_zip_regex:
  Ticket #4180: fix handling of zip archives.
2021-01-24 14:11:02 +03:00
Andrew Borodin
7881ed2fda Ticket #4180: fix handling of zip archives.
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>
2021-01-23 21:10:04 +03:00
Andrew Borodin
a88a626e76 Fix segfault on switch to subshell in mcedit/mcview/mcdiffview.
(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>
2021-01-18 21:27:26 +03:00
Yury V. Zaytsev
33c84e75e6 Update doc/NEWS file
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2021-01-10 15:17:18 +01:00
Yury V. Zaytsev
eaee877af6 Update hints translations from Transifex
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2021-01-10 15:10:32 +01:00
Yury V. Zaytsev
eafffd8459 Update translations from Transifex
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2021-01-10 13:40:54 +01:00
Andrew Borodin
fd65a1654d (edit_store_macro_cmd): restore lost 'else'.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-01-05 08:27:42 +03:00
Andrew Borodin
5a45ed1583 Fix segfault on adding current path to hotlist.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-01-03 08:15:56 +03:00
Andrew Borodin
485ea75cbe Merge branch '4103_cleanup'
* 4103_cleanup: (56 commits)
  Update po/*.po files.
  (tree_store_load_from): remove extra parenthesis.
  (tree_store_load_from): fix copy-into-fixed-size-buffer warning.
  (create_panel): remove extra test of midnight_dlg.
  (edit_scroll_screen_over_cursor): fix copy-paste error.
  (pipe_mail): fix unchecked return value warning.
  tests/lib/strutil/Makefile.am: remove unsed include path.
  (edit_read_syntax_file): fix logically dead code.
  (edit_suggest_current_word): the NULL check is unnecessary...
  (edit_get_match_keyword_cmd): fix possible NULL dereference.
  (x_basename): the NULL check is unnecessary...
  (mcview_growbuf_read_until): the NULL check is unnecessary...
  (cpio_read_bin_head): fix unintended sign extension.
  Move cd_to() to separate file.
  Refactoring: rename functions
  (do_cd_command): refactoring: get path only
  (examine_cd): return GString.
  (copy_file_file): minor refactoring.
  (handle_console_linux): fix resource leak.
  (open_error_pipe): fix resource leak.
  ...
2020-12-31 16:35:22 +03:00
Andrew Borodin
f8a88007f4 Update po/*.po files.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:34:55 +03:00
Andrew Borodin
01ca2756e1 (tree_store_load_from): remove extra parenthesis.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andrew Borodin
1c8400d6ef (tree_store_load_from): fix copy-into-fixed-size-buffer warning.
Found by Coverity.
Coverity id #32616.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andrew Borodin
a17dd53c29 (create_panel): remove extra test of midnight_dlg.
midnight_dlg is never NULL in create_panel().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andreas Mohr
3cd408407d (edit_scroll_screen_over_cursor): fix copy-paste error.
Found by Coverity.
Coverity id #32566.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andreas Mohr
3114240921 (pipe_mail): fix unchecked return value warning.
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>
2020-12-31 16:26:47 +03:00
Andrew Borodin
c1ed403c02 tests/lib/strutil/Makefile.am: remove unsed include path.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andreas Mohr
dfb81a3dae (edit_read_syntax_file): fix logically dead code.
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>
2020-12-31 16:26:47 +03:00
Andreas Mohr
68b803e5c4 (edit_suggest_current_word): the NULL check is unnecessary...
...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>
2020-12-31 16:26:47 +03:00
Andreas Mohr
ae244077af (edit_get_match_keyword_cmd): fix possible NULL dereference.
Found by Coverity.
Coverity id #32609.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andreas Mohr
40b96b67dd (x_basename): the NULL check is unnecessary...
...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>
2020-12-31 16:26:47 +03:00
Andreas Mohr
a68f2d1202 (mcview_growbuf_read_until): the NULL check is unnecessary...
...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>
2020-12-31 16:26:47 +03:00
Andreas Mohr
f57e69ad29 (cpio_read_bin_head): fix unintended sign extension.
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>
2020-12-31 16:26:47 +03:00
Andrew Borodin
d37dbcca4c Move cd_to() to separate file.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andrew Borodin
344af14029 Refactoring: rename functions
_do_panel_cd -> panel_do_cd_int
do_panel_cd -> panel_do_cd
do_cd -> panel_cd
do_cd_command -> cd_to

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andrew Borodin
e3519f8966 (do_cd_command): refactoring: get path only
...instead of command "cd path".

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andrew Borodin
6f96cad1ca (examine_cd): return GString.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andrew Borodin
38fee964bc (copy_file_file): minor refactoring.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andreas Mohr
5f482396f6 (handle_console_linux): fix resource leak.
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>
2020-12-31 16:26:47 +03:00
Andreas Mohr
61f997de26 (open_error_pipe): fix resource leak.
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>
2020-12-31 16:26:47 +03:00
Andrew Borodin
35911c08e1 (do_background): fix yet another resource leak.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andreas Mohr
88b6c3e930 (do_background): fix resource leak.
Found by Coverity.

Coverity id #32606.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andreas Mohr
9d8cd79dde (mouse_get_local): fix uninitialized scalar variable.
Found by Coverity.

Coverity id #32631.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andreas Mohr
e7a4f0932d (search_content): fix uninitialized scalar variable.
Found by Coverity.

Coverity id #32628.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andreas Mohr
0281ba51b7 (tar_read_header): fix uninitialized scalar variable.
Found by Coverity.

Coverity id #32634.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andreas Mohr
7916e8e097 src/vfs/fish/fish.c: fix uninitialized scalar variable.
Found by Coverity.

Coverity id #32630.
Coverity id #164548.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andreas Mohr
a37a4eba73 src/vfs/extfs/extfs.c: fix uninitialized scalar variable.
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>
2020-12-31 16:26:47 +03:00
Andreas Mohr
57f5ab7c23 Add break before empty default in switch.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andrew Borodin
3d4d6dbb41 (advanced_chown_refresh): constify atgument.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andrew Borodin
819e0908f6 src/filemanager/ext.c: minor refactoring.
(exec_get_export_variables): return GString.
(exec_make_shell_string): likewise.
(exec_extension): exec_get_export_variables() and
exec_make_shell_string() retur GString now.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andreas Mohr
a13c0a5e42 (hotlist_run_cmd): fix fallthrough annotation warning.
fallthrough annotation does not directly precede switch label.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andrew Borodin
9040cc3476 Fix typos. 2020-12-31 16:26:46 +03:00
Andrew Borodin
a358c8037d src/filemanager/mountlist.c: recognize more file system types as remote.
Sync with gnulib dd1fc46be12d671c1a9d9dc5a6fa8c766e99aa2f.

Sync "remote" file systems from stat.c in coreutils.
Note we only consider file systems that do not use host:resource
mount source.  I.e. those that don't generally use a colon when
mounting, as that case is already considered.  Searching for
"<fstype> /etc/fstab" was informative for identifying these.
The full list of "remote" file systems in coreutils is currently:
  acfs afs ceph cifs coda fhgfs fuseblk fusectl
  gfs gfs2 gpfs ibrix k-afs lustre novell nfs nfsd
  ocfs2 panfs prl_fs smb smb2 snfs vboxsf vmhgfs vxfs
Note also we do not include virtual machine file systems,
as even though they're remote to the current kernel,
they are generally not distributed to separate hosts.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andrew Borodin
4fd2706f47 lib/dialog.h: include "lib/keybind.h" (due to global_keymap_t).
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andrew Borodin
cc470c615a (tty_clear_screen): rename from clr_scr and move to lib/tty.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andrew Borodin
247ce0928d src/filemanager/find.c: get rid of global variable current_panel usage.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andrew Borodin
adb252c93e (single_dirsize_cmd): don't use global variable current_panel.
(dirsize_cmd): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andrew Borodin
59070e8313 (change_panel): return current_panel.
(chdir_other_panel): use result of change_panel() instead of global
variable current_panel.  (chdir_to_readlink): likewise.
(tree_chdir_sel): likewise.
(quick_view_cmd): mark that we don't use the result of change_panel().
(midnight_execute_cmd): likewise.
(panel_mouse_callback): likewise.
(tree_mouse_callback): likewise.
(mcview_mouse_callback): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andrew Borodin
be14894455 (panel_select_ext_cmd): get rid of global variable current_panel usage.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andrew Borodin
84e1bfcbd7 (panel_sync_other): get rid of global variable current_panel usage.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00