Commit Graph

15543 Commits

Author SHA1 Message Date
Andrew Borodin 1da094ae4a (mc_search__recode_str): return GString.
(mc_search__get_one_symbol): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-10-10 21:07:40 +03:00
Andrew Borodin 7a65d5200b (mc_search_regex__process_append_str): free string at end of loop.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-10-10 21:07:40 +03:00
Andrew Borodin 32c2ec9a91 (mc_search__change_case_str): refactoring.
Rename variables.
Allocate destination buffer instead of string duplicate.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-10-10 21:07:40 +03:00
Andrew Borodin e3421df1dd mc_search: refactoring.
Bodies of mc_search__tolower_case_str() and mc_search__toupper_case_str()
are almost same excluding the case conversion function call:
mc_search__tolower_case_str() calls str_tolower() and
mc_search__toupper_case_str() calls str_toupper.

Move this common body to separate function and call case conversion
function via pointer.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-10-10 21:07:40 +03:00
Andrew Borodin 47b116b773 mc_search: refactoring.
(mc_search_t): use GString to keep original search string. Join search string
and charset to structure.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-10-10 21:07:40 +03:00
Andrew Borodin f778c86e4d Revert "(extfs_open_archive): fix NULL dereferences."
This reverts commit 0df10f488b.

g_strconcat() accepts NULL after non-NULL arguments.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-10-10 21:07:40 +03:00
Andrew Borodin 2d7616e3c6 filehighlight.ini: add TypeScript tsx files to sources.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-10-10 21:07:40 +03:00
Andrew Borodin d60e3d5311 filehighlight.ini: add Markdown mkd files to documents. 2022-10-10 21:07:40 +03:00
Sergei Trofimovich 8318e3172d Ticket #4400: fix --enable-configure-args description.
Before the change the description said:

    Handle all compiler warnings as errors

Looks like a leftover from --enable-werror copy.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-10-10 21:07:40 +03:00
Andrew Borodin 116b6a616a (fish_dir_load): move `ls -l` output parser to separate function.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-10-10 21:07:40 +03:00
Ovsyannikov Sergey E 3e7424a95a FTP fixes.
* (parse_ls_line): fix get of file GID.
  * (ftpfs_parse_long_list_MLSD): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-10-10 21:07:40 +03:00
Ovsyannikov Sergey E 21c45e8a7a Cosmetics: add spaces around slash in statistics messages.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-10-10 21:07:40 +03:00
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