Commit Graph

15452 Commits

Author SHA1 Message Date
Andrew Borodin 9f6ef611f4 (ftpfs_setup_passive_epsv): join tests.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:04 +03:00
Andrew Borodin e2521d2187 (do_subshell_chdir): trivial refactoring.
Change tests to place short branches before long ones.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:04 +03:00
Andrew Borodin 6a83438163 (vfs_s_retrieve_file): use symbolic name for array size.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:04 +03:00
Andrew Borodin 2a80ea54dd (widget_init): remove double assignments.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:04 +03:00
Andrew Borodin e6cccfbd82 (canonicalize_pathname): make inline.
(canonicalize_pathname_custom): fix description.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:04 +03:00
Andrew Borodin e42012d51e FISH: refactoring.
* fish_super_t::scr_env: change type to GString.
  * (fish_set_env): return GString, rename variable.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:04 +03:00
Andrew Borodin 5a40f24658 (vfs_path_build_url_params_str): return GString.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:04 +03:00
Andrew Borodin ab897e4ca6 (vfs_path_element_build_pretty_path_str): return GString.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:04 +03:00
Andrew Borodin b3dd7cfe60 (find_parameters): use vfs_path_len().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:04 +03:00
Andrew Borodin f114af83c8 (edit_find_filter): refactoring.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:04 +03:00
Andrew Borodin 41ed8c13ee (edit_insert_stream): refactoring.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:04 +03:00
Andrew Borodin 7031508550 (command_completion_function): don't call canonicalize_pathname()
...because mc_build_filename() makes that.

(etags_set_definition_hash): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:04 +03:00
Andrew Borodin 328d27ccf1 Ticket #4426: code clean up before 4.8.30 release.
(sftpfs_cb_open): minor optimization.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:04 +03:00
Andrew Borodin a01fe38897 Merge branch '4434_mc.ext.ini_default_action'
* 4434_mc.ext.ini_default_action:
  Ticket #4434: mc.ext.ini: 'Edit' command from 'Default' section is ingored.
2023-01-23 20:50:50 +03:00
Andrew Borodin e254656c48 Ticket #4434: mc.ext.ini: 'Edit' command from 'Default' section is ingored.
(regex_command_for): execute the required action from the 'Default'
section if this action is not specified in the found section.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-23 20:27:01 +03:00
Andrew Borodin a4d254c6ec Ticket #4429: multi-line search is buggy.
Revert "Ticket #400: support multi-line search."

This reverts commit e370818c09.

Update doc/README.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-15 16:10:38 +03:00
Andrew Borodin b2ffac752f Ticket #4427: extfs: "Inconsistent archive" error for valid RPM.
(extfs_read_archive): fix condition to display message "Inconsistent archive".

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-15 10:47:19 +03:00
Yury V. Zaytsev 6d7d3e882b Update hints translations from Transifex
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2023-01-14 20:12:11 +01:00
Yury V. Zaytsev 882ac6b567 Update translations
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2023-01-14 20:08:18 +01:00
Andreas Mohr 8a6b2cb91c Ticket #4425: (mc_search__change_case_str): fix heap buffer overflow.
Normal start result in this AddressSanitizer hit.

=================================================================
==17167==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60200005b251 at pc 0x5983b1c3be5f bp 0x7ffcc27f4310 sp 0x7ffcc27f4308
WRITE of size 1 at 0x60200005b251 thread T0
    #0 0x5983b1c3be5e in mc_search__change_case_str /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/search/lib.c:84:14
    #1 0x5983b1c3c03f in mc_search__toupper_case_str /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/search/lib.c:200:12
    #2 0x5983b1d1b434 in mc_search__cond_struct_new_regex_hex_add /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/search/regex.c:130:11
    #3 0x5983b1d1ad7f in mc_search__cond_struct_new_regex_accum_append /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/search/regex.c:180:17
    #4 0x5983b1d147c9 in mc_search__cond_struct_new_regex_ci_str /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/search/regex.c:251:5
    #5 0x5983b1d136fa in mc_search__cond_struct_new_init_regex /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/search/regex.c:817:39
    #6 0x5983b1c3d7f0 in mc_search__cond_struct_new /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/search/search.c:80:9
    #7 0x5983b1c3d2e5 in mc_search_prepare /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/search/search.c:219:26
    #8 0x5983b1c3d9c3 in mc_search_run /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/search/search.c:297:10
    #9 0x5983b1c359f2 in mc_fhl_get_color_regexp /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/filehighlight/get-color.c:243:9
    #10 0x5983b1c35385 in mc_fhl_get_color /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/filehighlight/get-color.c:278:19
    #11 0x5983b1a1208f in file_compute_color /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/panel.c:784:12
    #12 0x5983b1a10bfd in format_file /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/panel.c:814:17
    #13 0x5983b1a0fb17 in repaint_file /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/panel.c:954:15
    #14 0x5983b1a0c0b6 in paint_dir /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/panel.c:1071:9
    #15 0x5983b19fab96 in panel_callback /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/panel.c:3731:9
    #16 0x5983b1d08775 in widget_draw /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/widget-common.c:539:19
    #17 0x5983b1d078eb in widget_default_set_state /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/widget-common.c:841:17
    #18 0x5983b1cb3c0b in widget_set_state /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/../../lib/widget/widget-common.h:383:12
    #19 0x5983b1cb286c in group_default_set_state /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/group.c:691:17
    #20 0x5983b1caa8ab in widget_set_state /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/../../lib/widget/widget-common.h:383:12
    #21 0x5983b1cacd14 in dlg_init /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/dialog.c:540:5
    #22 0x5983b1cada9d in dlg_run /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/dialog.c:601:5
    #23 0x5983b19cddd9 in do_nc /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/filemanager.c:1827:16
    #24 0x5983b1999605 in main /tmp/portage/app-misc/mc-9999/work/mc-9999/src/main.c:455:21
    #25 0x7d3944d620cb  (/lib64/libc.so.6+0x220cb)
    #26 0x7d3944d6217b in __libc_start_main (/lib64/libc.so.6+0x2217b)
    #27 0x5983b18d7d10 in _start (/usr/bin/mc+0x277d10)

0x60200005b251 is located 0 bytes to the right of 1-byte region [0x60200005b250,0x60200005b251)
allocated by thread T0 here:
    #0 0x5983b195ee89 in malloc (/usr/bin/mc+0x2fee89)
    #1 0x7d3945014ef9 in g_malloc (/usr/lib64/libglib-2.0.so.0+0x54ef9)
    #2 0x5983b1c3c03f in mc_search__toupper_case_str /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/search/lib.c:200:12
    #3 0x5983b1d1b434 in mc_search__cond_struct_new_regex_hex_add /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/search/regex.c:130:11
    #4 0x5983b1d1ad7f in mc_search__cond_struct_new_regex_accum_append /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/search/regex.c:180:17
    #5 0x5983b1d147c9 in mc_search__cond_struct_new_regex_ci_str /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/search/regex.c:251:5
    #6 0x5983b1d136fa in mc_search__cond_struct_new_init_regex /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/search/regex.c:817:39
    #7 0x5983b1c3d7f0 in mc_search__cond_struct_new /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/search/search.c:80:9
    #8 0x5983b1c3d2e5 in mc_search_prepare /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/search/search.c:219:26
    #9 0x5983b1c3d9c3 in mc_search_run /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/search/search.c:297:10
    #10 0x5983b1c359f2 in mc_fhl_get_color_regexp /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/filehighlight/get-color.c:243:9
    #11 0x5983b1c35385 in mc_fhl_get_color /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/filehighlight/get-color.c:278:19
    #12 0x5983b1a1208f in file_compute_color /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/panel.c:784:12
    #13 0x5983b1a10bfd in format_file /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/panel.c:814:17
    #14 0x5983b1a0fb17 in repaint_file /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/panel.c:954:15
    #15 0x5983b1a0c0b6 in paint_dir /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/panel.c:1071:9
    #16 0x5983b19fab96 in panel_callback /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/panel.c:3731:9
    #17 0x5983b1d08775 in widget_draw /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/widget-common.c:539:19
    #18 0x5983b1d078eb in widget_default_set_state /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/widget-common.c:841:17
    #19 0x5983b1cb3c0b in widget_set_state /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/../../lib/widget/widget-common.h:383:12
    #20 0x5983b1cb286c in group_default_set_state /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/group.c:691:17
    #21 0x5983b1caa8ab in widget_set_state /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/../../lib/widget/widget-common.h:383:12
    #22 0x5983b1cacd14 in dlg_init /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/dialog.c:540:5
    #23 0x5983b1cada9d in dlg_run /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/dialog.c:601:5
    #24 0x5983b19cddd9 in do_nc /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/filemanager.c:1827:16
    #25 0x5983b1999605 in main /tmp/portage/app-misc/mc-9999/work/mc-9999/src/main.c:455:21
    #26 0x7d3944d620cb  (/lib64/libc.so.6+0x220cb)

SUMMARY: AddressSanitizer: heap-buffer-overflow /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/search/lib.c:84:14 in mc_search__change_case_str
Shadow bytes around the buggy address:
  0x0c04800035f0: fa fa fd fa fa fa fd fd fa fa fd fa fa fa fd fa
  0x0c0480003600: fa fa fd fa fa fa fd fa fa fa fd fa fa fa fd fa
  0x0c0480003610: fa fa fd fa fa fa fd fa fa fa fd fa fa fa fd fd
  0x0c0480003620: fa fa fd fa fa fa fd fa fa fa fd fa fa fa fd fa
  0x0c0480003630: fa fa fd fa fa fa fd fa fa fa fd fa fa fa fd fa
=>0x0c0480003640: fa fa fd fa fa fa fd fa fa fa[01]fa fa fa fa fa
  0x0c0480003650: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c0480003660: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c0480003670: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c0480003680: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c0480003690: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==17167==ABORTING

Found by clang 15.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-14 15:43:00 +03:00
Andrew Borodin ce16fa5746 Merge branch '4422_extfs_segfault'
* 4422_extfs_segfault:
  Update doc/NEWS file.
  (extfs_read_archive): show error message.
  Ticket #4422: extfs: segfault if archive contains file(s) in the parent directory.
2023-01-11 18:48:11 +03:00
Andrew Borodin 3179ee468c Update doc/NEWS file.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-11 18:47:44 +03:00
Andrew Borodin 9962abd701 (extfs_read_archive): show error message.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-07 09:27:54 +03:00
Jindrich Novy 69ed5696f2 Ticket #4422: extfs: segfault if archive contains file(s) in the parent directory.
zip archive can contain files outside archive root:

$ unzip -l tmp.zip
Archive:  tmp.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  2023-01-04 19:43   a
        0  2023-01-04 19:43   b
        0  2023-01-04 19:43   ../c
        0  2023-01-04 19:43   ../../d
---------                     -------
        0                     4 files

Enter into such archive leads to a segfault.

(extfs_find_entry_int): fix possible NULL dereference. The result of this
fix is an impossibility to enter into such archive.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-07 09:27:24 +03:00
Yury V. Zaytsev ba64c89b97 Update doc/NEWS file
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2023-01-05 22:23:48 +01:00
Yury V. Zaytsev fa4cc035ed Update hints translations from Transifex
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2023-01-05 22:04:52 +01:00
Yury V. Zaytsev a7dcbbbdf7 maint: specify translations explicitly when pulling hints from transifex 2023-01-05 22:02:36 +01:00
Yury V. Zaytsev 168ec3307a Update translations from Transifex
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2023-01-05 21:49:24 +01:00
Yury V. Zaytsev 3b5b58fb75 maint: add auto-sync of pot & hints to transifex 2023-01-05 21:38:35 +01:00
Yury V. Zaytsev e6ee031fc0 maint: allow pushing hints pot to transifex without pulling translations first 2023-01-05 21:36:43 +01:00
Yury V. Zaytsev 6da4346c4e maint: rewrite translation management scripts 2023-01-03 22:53:48 +01:00
Yury V. Zaytsev b88d1b3790 maint: remove dead hint files 2023-01-02 21:56:28 +01:00
Yury V. Zaytsev 9d7a83aec6 maint: update address protocol and mailing list information 2023-01-02 21:43:20 +01:00
Yury V. Zaytsev 2447d422de maint: update message catalog (change address protocol) 2023-01-02 21:37:00 +01:00
Andrew Borodin 5583c3d9c0 Merge branch '4420_sftp_network_vfs'
* 4420_sftp_network_vfs:
  Ticket #4420: fail to build with only SFTP network VFS enabled.
2022-12-30 08:09:28 +03:00
Andrew Borodin b69168cfb5 Ticket #4420: fail to build with only SFTP network VFS enabled.
* m4.include/mc-vfs.m4: use $enable_vfs_sftp to test functions
    required for network VFSes. Define ENABLE_VFS_NET preprocessor
    macro here...
  * lib/vfs/vfs.h: ...not here.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-12-30 08:08:47 +03:00
Andrew Borodin 995b61db9e Merge branch '4419_makefile_regex'
* 4419_makefile_regex:
  Ticket #4419: mc.ext.ini: clarify regex for makefiles.
2022-12-30 08:05:40 +03:00
Andrew Borodin 7230269ce4 Ticket #4419: mc.ext.ini: clarify regex for makefiles.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-12-18 14:44:27 +03:00
Andrew Borodin 0ac611f15c Merge branch '4320_syntax_location'
* 4320_syntax_location:
  Ticket #4320: syntax/Syntax: document location of syntax files.
2022-12-18 14:27:04 +03:00
Andrew Borodin cea7d35209 Ticket #4320: syntax/Syntax: document location of syntax files.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-12-18 14:26:30 +03:00
Andrew Borodin 2df6771645 Merge branch '4413_user_syntax'
* 4413_user_syntax:
  Ticket #4413: mcedit: syntax definitions in user location don't work.
2022-12-18 14:20:58 +03:00
Andrew Borodin 3f882f50e0 Ticket #4413: mcedit: syntax definitions in user location don't work.
Fix location of all user's syntax related stuff. Now it is the
~/.local/share/mc/syntax/ directory.

Don't use the system configuration directory (/etc/mc) as a storage
of syntax definitions.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-12-18 14:20:36 +03:00
Andrew Borodin f98cda9ff3 doc: add substitution for %pkglibexecdir% and %pkgdatadir% in man pages.
%prefix% isn't used anymore, remove it.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-12-03 13:05:15 +03:00
Andrew Borodin ebb011a047 Merge branch '3121_empty_subshell_prompt'
* 3121_empty_subshell_prompt:
  Ticket #3121: empty subshell/command line prompt.
2022-12-03 13:04:56 +03:00
Andrew Borodin 1ac5c22517 Ticket #3121: empty subshell/command line prompt.
If subshell is initializing more than 1 second - we have no subshell.

(feed_subshell): change timeout to 10 secons. I belive that is more than
enough time to run subshell.

Thanks Alexandr Zamaraev (aka Tonal) <tonal.promsoft@gmail.com> and
antonio_so <sozonnik@gmail.com> for finding out the cause of the
problem.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-11-26 14:21:55 +03:00
Alexander Fadeev 87bfef7317 Ticket #4412: add TOML (Tom's Obvious Minimal Language) syntax highlighting.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-11-26 09:44:24 +03:00
Andrew Borodin 9507ceda20 Merge branch '3220_compare_panelized'
* 3220_compare_panelized:
  Ticket #3220: fix directory comparision in panelized panel.
2022-11-26 09:39:40 +03:00
Andrew Borodin a72ede698e Ticket #3220: fix directory comparision in panelized panel.
Directory comparision expects only file names in both panels.
In panelized panel, files named can contain paths:

| boxes.c   | 43220|| 1/boxes.c   | 43220|
| boxes.h   | 1429 || 1/boxes.h   |  1429|
|           |      || boxes.c     | 43220|
|           |      || boxes.h     |  1429|

Even if boxes.c and 1/boxes.c files are the same, they are marked as
different because strings "boxes.c" and "1/boxes.c" are different.

The solution: for panelized panel, ignore path and use file name only
(like output of basename(3)) for comparision.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-11-14 20:59:05 +03:00
Andrew Borodin 3250536c15 Merge branch '4409_copy_continue'
* 4409_copy_continue:
  Update po/*.po files.
  Ticket 4409: continue copy after interrupt.
2022-10-23 20:25:09 +03:00
Andrew Borodin 4eac28b3b5 Update po/*.po files.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-10-23 20:24:43 +03:00