Commit Graph

15358 Commits

Author SHA1 Message Date
Sergei Trofimovich
6b67d231a2 Ticket #4399: configure.ac: introduce PERL_FOR_BUILD
Most of mc uses of PERL is to embed path to the interpreter in VFS
helpers. There we can use path to perl for --host. But
`date-of-man-include.am` is the place where perl is used for --build.

On most systems both paths are expected to be /usr/bin/perl.
But on some systems paths might differ a bit. Most prominent
example is NixOS, where packages get installed into unique prefixes:

$ file /nix/store/...-perl-5.36.0/bin/perl \
       /nix/store/...-perl-powerpc64-unknown-linux-gnu-5.36.0/bin/perl
/nix/store/...-perl-5.36.0/bin/perl:
  ELF 64-bit LSB executable, x86-64, version 1 (SYSV), ...
/nix/store/...-perl-powerpc64-unknown-linux-gnu-5.36.0/bin/perl:
  ELF 64-bit MSB executable, 64-bit PowerPC or cisco 7500, ...

This allows running both binaries via qemu-user if needed for tests.

The change introduces PERL_FOR_BUILD (similar to autoconf's CC_FOR_BUILD
and friends) to allow passing both PERLs when needed.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-08-20 08:26:24 +03:00
Andrew Borodin
08cca8aae8 Merge branch '400_multiline_search'
* 400_multiline_search:
  Ticket #400: support multi-line search.
2022-08-14 18:03:40 +03:00
Steef Boerrigter
e370818c09 Ticket #400: support multi-line search.
In order to use multiline search, select "Regular expression" mode and
use "\n" in the input line:

For example, if file contains lines

aaa
bbb

search string should be "aaa\nbbb".

As a side effect, non-printable ASCII symbols (\r, \t, etc) in the
search string can be used too.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-08-14 18:02:23 +03:00
Andrew Borodin
1a2682dfab Merge branch '4398-quicview_segfault'
* 4398-quicview_segfault:
  Ticket #4398: crash on quick view of archives.
2022-08-14 17:58:09 +03:00
Andrew Borodin
ff26ce85f8 Ticket #4398: crash on quick view of archives.
* (extfs_cmd): make message null-terminated.
  * (sfs_vfmake): likewise.
  * (do_external_panelize): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-08-14 17:57:08 +03:00
Andrew Borodin
0b86047c81 Merge branch '4397_winput_api_fixes'
* 4397_winput_api_fixes:
  Clarify checks of input line content returned from quick dialog.
  (input_get_ctext): mew API.
  (input_destroy): remove check if WInput object is NULL. This object must exist.
  WInput: make one-line APIs inline.
  (input_is_empty): remove checks. WInput object must exist.
  Ticket #4397: sort in editor without arguments stopped working.
2022-08-14 17:53:05 +03:00
Andrew Borodin
36abab7186 Clarify checks of input line content returned from quick dialog.
If quick dialog is finished with value other than B_CANCEL,
string value of input line isn't NULL.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-08-04 11:19:16 +03:00
Andrew Borodin
79645187c6 (input_get_ctext): mew API.
Use it instead of direct access to WInput's buffer.

(handle_cmdline_enter): additional minor refactoring.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-08-04 11:17:29 +03:00
Andrew Borodin
28154dc520 (input_destroy): remove check if WInput object is NULL. This object must exist.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-08-04 11:11:50 +03:00
Andrew Borodin
589155f6bf WInput: make one-line APIs inline.
* (input_get_text): make inline.
  * (input_is_empty): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-08-04 11:11:33 +03:00
Andrew Borodin
4e245291b4 (input_is_empty): remove checks. WInput object must exist.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-08-04 11:09:49 +03:00
Andrew Borodin
318315399b Ticket #4397: sort in editor without arguments stopped working.
* (input_get_text): never return NULL. If buffer is empty, return an
empty allocated string.
  * (input_push_history): use new input_get_text.
  * (find_parameters): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-08-04 11:09:42 +03:00
Andrew Borodin
9f15305dc2 Merge branch '4396_contour_terminal'
* 4396_contour_terminal:
  Ticket #4396: (tty_check_term): support Contour terminal.
2022-07-31 19:55:36 +03:00
Whisperity
6cd17f6bbf Ticket #4396: (tty_check_term): support Contour terminal.
Contour terminal: https://github.com/contour-terminal/contour.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-07-31 19:50:27 +03:00
Andrew Borodin
1c31e57c74 Merge branch '4391_edit_delete_macro'
* 4391_edit_delete_macro:
  (edit_delete_macro): do not resort macros after deleting one
  Ticket #4391: fix infinite loop when deleting an mceditor macro.
2022-07-27 19:22:22 +03:00
sxmboer2
cca4c46d05 (edit_delete_macro): do not resort macros after deleting one
...because g_array_remove_index() keeps the array sorted.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-07-27 19:22:05 +03:00
sxmboer2
01c3c56140 Ticket #4391: fix infinite loop when deleting an mceditor macro.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-07-27 19:22:05 +03:00
Andrew Borodin
82da1e88c7 Merge branch '4381_mouse_drag'
* 4381_mouse_drag:
  Ticket #4381: missing selection of some files.
2022-07-27 19:11:09 +03:00
Andrew Borodin
6ea06c9845 Ticket #4381: missing selection of some files.
When files are selected keeping the right mouse button pressed,
some files are not selected.

  * Add new macros for mouse pointer location relative to file list.
  * (mark_if_marking): select/unselect all files between previous
    selected file and new one.
  * (panel_mouse_is_on_item): return clarified value of mouse pointer location.
  * (panel_mouse_callback): modify mouse drag event handling in accordance with
    the mouse pointer location relatively to the file list.

Also fixes ticket #4119: "Cannot scroll panel listing upwards using mouse".

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-07-27 19:10:16 +03:00
Andrew Borodin
cd47b158ac Ticket #4373: restore menu accelerator for "Sort order" item.
Menu according for "Sort order" item was changed in
d19b247c6d in order to fix shotrcut
conflict. Restore it back according to user requests.

óhange accelerator for "SFTP link" from S to N.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-07-11 19:44:43 +03:00
Pavel Shumskii
971de9651c Ticket #4059: improve YAML multiline blocks syntax highliting.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-07-09 20:10:31 +03:00
Bogdan Pylypenko
08ab71d49b Ticket #4384: mceditor: add syntax file for Privoxy.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-07-03 15:46:22 +03:00
Andrew Borodin
ab63cd2a94 Merge branch '4377_file_b'
* 4377_file_b:
  "file" utility: use -b option if available.
  Ticket #4377: file type check does not work with special character in filename.
2022-07-03 15:38:05 +03:00
Andrew Borodin
debabe561a "file" utility: use -b option if available.
* configure.ac: test if "file" utility has -b option.
  * (regex_check_type): don't compare file names if "file -b" is used.
Reduce variable scope. Rename variable.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-26 20:03:47 +03:00
Andrew Borodin
0bb9c04720 Ticket #4377: file type check does not work with special character in filename.
Initial commit: clarify usage of "file" utility.

  * (get_popen_information): compile conditionally depending on USE_FILE_CMD
macro.
  * (get_file_type_local): likewise.
  * (get_file_encoding_local): likewise.
  * (regex_check_type): likewise.
  * (regex_command_for): ignore type method if file utiliti isn't used.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-26 19:57:37 +03:00
Andrew Borodin
6c45208744 Fix indentation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 20:12:46 +03:00
Andrew Borodin
6f2833a422 Merge branch '4357_cleanup'
* 4357_cleanup: (39 commits)
  Update po/*.po files.
  src/filemanager/dir.c: minor sort optimization.
  lib/util.h: fix typo.
  (edit_sort_cmd): clarify hint for Sort command.
  (query_default_callback): clarify widget position.
  (mc_config_get_string): use mc_config_get_string_raw()
  (ftpfs_setup_active): clarify handling of getnameinfo() errors.
  (ftpfs_initconn): clarify errno setup.
  ftpfs.c: variable ftpfs_errno is assigned but never used.
  (ftpfs_dir_load): fix building of remote path.
  (vfs_s_subclass::dir_load): constify argument.
  Minor refactoring of path canonicalization.
  (mc_chdir): clarufy setup of errno.
  (vfs_path_get_by_index): set errno, update description.
  Fix ENOTSUP usage.
  mceditor: minor refactoring of file load.
  (edit_init): change argument for coordinates.
  (edit_add_window): change argument for coordinates.
  (widget_adjust_position): change argument for coordinates.
  (group_init): change argument for coordinates.
  ...
2022-06-05 19:50:03 +03:00
Andrew Borodin
a0ac476983 Update po/*.po files.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 19:49:32 +03:00
Andrew Borodin
1b93bae611 src/filemanager/dir.c: minor sort optimization.
Get rid of sort condition double check.

Condition

    ad == bd || panels_options.mix_all_files

was checked twice: first in sort_xxx(), then in sort_name() called in
sort_xxx().

Now this condition is checked in sort_xxx() only.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 12:19:47 +03:00
Andrew Borodin
f5399c6d4d lib/util.h: fix typo.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 12:19:47 +03:00
Andrew Borodin
c7af7f0bbd (edit_sort_cmd): clarify hint for Sort command.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 12:19:47 +03:00
Andrew Borodin
101714e39b (query_default_callback): clarify widget position.
If dialog should be placed too high (in the upper half of the screen
closer to the screen top), show it centered.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 12:19:47 +03:00
Andrew Borodin
4008d3b96c (mc_config_get_string): use mc_config_get_string_raw()
...to get rid of code duplcation.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 12:19:47 +03:00
Andrew Borodin
bae55d637a (ftpfs_setup_active): clarify handling of getnameinfo() errors.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 12:19:47 +03:00
Andrew Borodin
798f6e87b3 (ftpfs_initconn): clarify errno setup.
Handle errors of bind(), getsockname(), and listen() calls.
Return if one of these functions fails and setup errno to indicate the
cause of the error.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 12:19:47 +03:00
Andrew Borodin
03cef1bb6f ftpfs.c: variable ftpfs_errno is assigned but never used.
Use me->verrno directly instead.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 12:19:47 +03:00
Andrew Borodin
556cf2274d (ftpfs_dir_load): fix building of remote path.
Call of mc_build_filename(remote_path, ".") is pointless
because the path canonicalization is performed and trailing
"/." is removed.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 12:19:47 +03:00
Andrew Borodin
ebb328353e (vfs_s_subclass::dir_load): constify argument.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 12:19:44 +03:00
Andrew Borodin
db8bc2fbff Minor refactoring of path canonicalization.
(canon_path_flags_t): rename from CANON_PATH_FLAGS, add
CANON_PATH_NOCHANGE value, clarify comments.
(canonicalize_pathname_custom): rename from custom_canonicalize_pathname,
update description.
(canonicalize_pathname): add description.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 12:17:59 +03:00
Andrew Borodin
4ceb5c5105 (mc_chdir): clarufy setup of errno. 2022-06-05 12:00:26 +03:00
Andrew Borodin
bae8fe0af0 (vfs_path_get_by_index): set errno, update description.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 12:00:25 +03:00
Andrew Borodin
666586e41a Fix ENOTSUP usage.
Remove E_NOTSUPP define. Use ENOTSUP directly where required.

(vfs_clone_file): use ENOTSUP instead of EOPNOTSUPP.
(mc_open): likewize. Fix sign.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 11:59:32 +03:00
Andrew Borodin
5f746eea0c mceditor: minor refactoring of file load.
(edit_load_file_from_filename): make public, use it as main function to
load file and create editor window.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 11:56:32 +03:00
Andrew Borodin
12543835f9 (edit_init): change argument for coordinates.
Use WRect instead of four values.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 11:56:31 +03:00
Andrew Borodin
533b2076dd (edit_add_window): change argument for coordinates.
Use WRect instead of four values.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 11:55:06 +03:00
Andrew Borodin
caf41457c6 (widget_adjust_position): change argument for coordinates.
Use WRect instead of four values.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 11:55:06 +03:00
Andrew Borodin
390d614b5e (group_init): change argument for coordinates.
Use WRect instead of four values.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 11:55:06 +03:00
Andrew Borodin
ccdc909105 (widget_init): change argument for coordinates.
Use WRect instead of four values.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 11:55:03 +03:00
Andrew Borodin
2759d080cf Viewer: use WRect to hold position and size of various areas.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 11:52:14 +03:00
Andrew Borodin
aac258e44e (rect_grow): new API.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 11:50:19 +03:00