Commit Graph

15381 Commits

Author SHA1 Message Date
Andrew Borodin
bb3ace13f1 Enlarge subshell PTY buffer.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-10-10 21:07:40 +03:00
Andrew Borodin
a7833b5b2e (real_warn_same_file): truncate file names if required.
If file name is too long, message window is wider than screen.
Truncate file name to fit it in the screen.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-10-10 21:07:40 +03:00
Andrew Borodin
facf199f65 (fish_free_archive): check socket before close.
Find by Coverity.
Coverity id #313668.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-10-10 21:07:40 +03:00
Andreas Mohr
1431d8b692 (ins_from_clip): fix maybe-uninitialized warning.
../../../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>
2022-10-10 21:07:40 +03:00
Andrew Borodin
c441250beb mcviewer: move.c: fix coding style. 2022-10-10 21:07:40 +03:00
Andrew Borodin
fba3d47408 mcviewer: internal.h: fix coding style. 2022-10-10 21:07:40 +03:00
Andrew Borodin
5db6715a5f VFS: don't use vfs_s_inode::data_offset for file name normalization.
Use new member vfs_s_entry::leading_spaces for that.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-10-10 21:07:40 +03:00
Andrew Borodin
52fd6215b0 Ticket #4357: code clean up before 4.8.29 release.
(vfs_s_open): minor optimization.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-10-10 21:07:40 +03:00
Andrew Borodin
e48cd98ac1 Merge branch '4404_zip_magic'
* 4404_zip_magic:
  Fix detection of zip-compressed file.
  Ticket #4404: wrong decompressot for zip files.
2022-10-09 14:08:59 +03:00
Andrew Borodin
b42e58dfbc Fix detection of zip-compressed file.
(compression_type): add COMPRESSION_ZIP value.
(decompress_extension): support COMPRESSION_ZIP.
(get_compression_type): fix zip-file detection.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-10-09 14:06:25 +03:00
Andrew Borodin
395569c685 Ticket #4404: wrong decompressot for zip files.
In quick view panel mode, gzip is used for view zip-files.

Initial commit:
(get_compression_type): use hex values instead of octal ones.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-10-09 14:06:25 +03:00
Andrew Borodin
7bbaa13644 Merge branch '4364_fish_remove_nonempty_dir'
* 4364_fish_remove_nonempty_dir:
  (check_dir_is_empty): clarify description.
  Ticket #4364: FISH VFS: cannot remove non-empty directory.
2022-10-09 14:03:09 +03:00
Andrew Borodin
72f5211327 (check_dir_is_empty): clarify description.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-10-09 14:02:19 +03:00
Andrew Borodin
d4d6cec52d Ticket #4364: FISH VFS: cannot remove non-empty directory.
Revert "(check_dir_is_empty): minor optimization."

This reverts commit 25e419ba08.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-10-02 11:13:17 +03:00
Andrew Borodin
3a3811c528 Merge branch '4141_mc.ext.ini'
* 4141_mc.ext.ini:
  Update po/*.po files.
  Port mc.ext to INI format.
  (regex_command_for): move load of extension file to separate function.
  (mc_config_has_param): use g_key_file_get_value()...
  Ticket #4141: allow compound (AND) conditions in mc.ext
2022-09-25 14:57:17 +03:00
Andrew Borodin
91c8daad9a Update po/*.po files. 2022-09-25 14:56:07 +03:00
Andrew Borodin
d9eeec9a5a Port mc.ext to INI format.
Ticket #2773: 'include' keyword (for command class def) have no effect
if it was defined before 'Include' keyword (for command def).

Ticket #3742: update comment in mc.ext.ini.

doc: remove mc.ext.ini format description from manual page.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-09-25 14:55:00 +03:00
Andrew Borodin
1cb66b82bd (regex_command_for): move load of extension file to separate function.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-08-28 11:10:39 +03:00
Andrew Borodin
cf660c7f9d (mc_config_has_param): use g_key_file_get_value()...
to check if a parameter exists.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-08-28 11:10:39 +03:00
Andrew Borodin
67ec86b570 Ticket #4141: allow compound (AND) conditions in mc.ext
...to disambiguate overloaded extensions

Initial commit:
  * rename macro for mc.ext file: MC_FILEBIND_FILE -> MC_EXT_FILE.
  * (ext_cmd): fix errorous usage of MC_LIB_EXT macro. Use MC_EXT_FILE
    instead.
  * (regex_command_for): likewise. Use already existing variable
    extension_file, remove variable filebind_filename.
  * MC_LIB_EXT: remove macro.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-08-28 11:10:39 +03:00
Andrew Borodin
1294c7bad1 Merge branch '4401_viewer_segfault'
* 4401_viewer_segfault:
  Ticket #4401: Segmentation fault in mcviewer.
2022-08-21 20:53:31 +03:00
Michael Schuster
a1f22e104d Ticket #4401: Segmentation fault in mcviewer.
* (mcview_growbuf_read_until): the previous call to mcview_show_error()
   invalidates sp by freeing view->ds_stdio_pipe. Reintroduce the check
   that was removed in a68f2d1202 but take
   sp's invalidity into account.

 * (mc_pclose): add a NULL pointer check to play safe.

Signed-off-by: Michael Schuster <michael@schuster.ms>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-08-20 19:33:12 +03:00
Andrew Borodin
0ef7237eea Merge branch '4399_perl_for_build'
* 4399_perl_for_build:
  Ticket #4399: configure.ac: introduce PERL_FOR_BUILD
2022-08-20 08:29:54 +03:00
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