Commit Graph

15543 Commits

Author SHA1 Message Date
Andrew Borodin 03ae9ff24a Ticket #4357: code clean up before 4.8.29 release.
(set_prompt_string): use mc_g_string_dup().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 11:21:22 +03:00
Andrew Borodin 0e583d756e Merge branch '4374_version_sort_fix2'
* 4374_version_sort_fix2:
  Ticket #4374: fix file sort by version.
2022-06-04 20:58:08 +03:00
Andrew Borodin dc67246c27 Ticket #4374: fix file sort by version.
filevercmp: don't treat entire filename as suffix.

Sync with gnulib 1ba2b66ea45f9bc43cdc0f6f93efa59157d2b2ba.

(file_prefixlen): When stripping (\.[A-Za-z~][A-Za-z0-9~]*)*$ suffixes,
do not strip the entire file name.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-04 09:01:43 +03:00
Andrew Borodin 34d3726b79 Merge branch '4374_version_sort_fix'
* 4374_version_sort_fix:
  Ticket #4374: fix file sort by version.
2022-05-29 12:14:41 +03:00
Andrew Borodin db109be8a2 Ticket #4374: fix file sort by version.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-05-23 20:56:31 +03:00
Andrew Borodin 2480f06b30 Merge branch '3670_ftp_reconnect'
* 3670_ftp_reconnect:
  Ticket #3670: ftp: reconnect if server terminated connection.
2022-05-22 11:36:37 +03:00
Andrew Borodin 81d57da867 Ticket #3670: ftp: reconnect if server terminated connection.
(ftpfs_init_data_socket): handle return value of
getpeername()/getsockname() and try to reconnect to FTP server
for 10 attempts in case of error.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-05-22 11:33:24 +03:00
Andrew Borodin aba8102088 Merge branch '4372_fish_resize'
* 4372_fish_resize:
  Ticket #4372: fish commands don't work after window resize.
2022-05-22 11:29:15 +03:00
Eric Roberts 4667618e68 Ticket #4372: fish commands don't work after window resize.
How to reproduce:
  start mc (with fish as your shell);
  resize mc window;
  type any command in the command prompt, for example, "ls";
  result: nothing happens;
  type the same command again;
  it works now, the second time.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-05-14 09:13:59 +03:00
Dima Gerasimov ebbdc8847e Ticket #4369: sqlite 3 view: use 'immutable=1' URI parameter
...to prevent leaving wal/shm files after viewing sqlite database.

The problem I often had with viewing .sqlite files with mc is that
exiting the view mode mid-way may leave .wal/.shm files in the database
directory.

This never caused any actual issues, but a bit annoying, since leftover
.wal files are often a sign that the program working with the database
exited ungracefully.

This effectively reproduces mc's behaviour:

    /tmp/testsqlite $ rm -f *-wal *-shm && sqlite3 "/tmp/testsqlite/db file.sqlite" .dump | head >/dev/null && ls -1 /tmp/testsqlite/
    'db file.sqlite'
    'db file.sqlite-shm'
    'db file.sqlite-wal'

After the change -- no shm/wal files

    /tmp/testsqlite $ rm -f *-wal *-shm && sqlite3 "file:/tmp/testsqlite/db file.sqlite?immutable=1" .dump | head >/dev/null && ls -1 /tmp/testsqlite/
    'db file.sqlite'

You can find the docs on immutable mode here:
https://www.sqlite.org/uri.html#uriimmutable

Immutable mode has been supported in sqlite since 2014:
https://www.sqlite.org/changes.html#version_3_8_5

In case user's sqlite installation is older, the mode is just quietly
ignored, so the change is backwards compatible.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-05-01 09:46:39 +03:00
Andrew Borodin 0091315adb Merge branch '1373_more_filter_options'
* 1373_more_filter_options:
  Update po/*.po files.
  Document new filter options.
  Load and save filter parameters.
  Implement more option for panel filter:
  Rename panel_select_flags_t -> select_flags_t.
  Handle CK_Filter command in the file panel level.
  Add macros for select/unselect histories.
  (panel_select_unselect_files_dialog): show error message if pattern is malformed.
  (mc_search_prepare): cache result.
  mc_search_struct: rename member: conditions -> prepared_conditions.
  Ticket #1373: add more options to "Filter" dialog window.
2022-04-17 20:39:07 +03:00
Andrew Borodin 9991818b61 Update po/*.po files.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-04-10 17:45:57 +03:00
Andrew Borodin 9aaa96625f Document new filter options.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-04-10 17:45:57 +03:00
Andrew Borodin a92b6781b8 Load and save filter parameters.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-04-10 17:45:57 +03:00
Andrew Borodin a705b67288 Implement more option for panel filter:
"Files only", "Case sensitive", and "Using shell patterns".

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-04-10 17:45:56 +03:00
Andrew Borodin f20f5cc5cb Rename panel_select_flags_t -> select_flags_t.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-04-10 17:44:26 +03:00
Andrew Borodin 63e870867e Handle CK_Filter command in the file panel level.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-04-10 17:43:44 +03:00
Andrew Borodin 450993fff6 Add macros for select/unselect histories.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-04-10 17:43:44 +03:00
Andrew Borodin 45073a9d29 (panel_select_unselect_files_dialog): show error message if pattern is malformed.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-04-10 17:43:42 +03:00
Andrew Borodin 0222169206 (mc_search_prepare): cache result.
mc_search_struct: add new member prepared.result to keep the result of
the mc_search_prepare() first call. It can be used to check a regexp
before call of mc_search_run() in a loop.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-04-10 17:42:43 +03:00
Andrew Borodin 975bf17d3b mc_search_struct: rename member: conditions -> prepared_conditions.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-04-10 17:42:43 +03:00
Andrew Borodin 733f7ce54b Ticket #1373: add more options to "Filter" dialog window.
The main idea is apply same options for file filter as for file
selection and use the same dialog window.

Initial commit: refactoring: move creation of the file selection dialog
to the separate function.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-04-10 17:42:39 +03:00
Yury V. Zaytsev 55124be9bb Update hints translations from Transifex
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2022-03-27 13:54:06 +02:00
Yury V. Zaytsev 26ea72d519 Update translations from Transifex
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2022-03-27 13:44:59 +02:00
Andrew Borodin e246196c76 Update Russian translation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-27 13:50:47 +03:00
Andrew Borodin 3055d0054f Synchronize LINGUAS with the current state of the repository.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-27 13:25:30 +03:00
Yury V. Zaytsev fa7cd003af Update doc/NEWS file
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2022-03-20 12:21:21 +01:00
Yury V. Zaytsev f0c36b6958 Update hints translations from Transifex
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2022-03-20 12:14:32 +01:00
Yury V. Zaytsev 93f6e4df43 Update translations from Transifex
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2022-03-20 11:49:13 +01:00
Zoltan Puskas 9bb705aaba Ticket #4351: file highlighting: add Markdown.
Add markdown into the document highlighting extensions list, since
it's quite popular in many places.

While there are many suggested extensions for the file type[1], this
commit only adds `.md` and `.markdown` as they are the recommended ones
in RFC7763[2] and by the creator themselves[3]. The rest is a hit and
miss anyway, with support highly dependant on the underlying system or
application, and are used infrequently.

[1]https://superuser.com/questions/249436/file-extension-for-markdown-files
[2]https://datatracker.ietf.org/doc/html/rfc7763
[3]https://daringfireball.net/linked/2014/01/08/markdown-extension

Signed-off-by: Zoltan Puskas <zoltan@sinustrom.info>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-19 21:04:58 +03:00
Andrew Borodin 7fe3f4c898 Merge branch '4270_cleanup'
* 4270_cleanup: (28 commits)
  Update po/*.po files.
  (mc_setup_by_args): reduce variable scope into #ifdef to fix coverity finding.
  (translate_file): refactoring.
  (get_random_hint): refactoring.
  Fix coding style.
  (dir_list_load): rename argument: fltr -> filter.
  (show_version): display version of libssh2.
  (sftpfs_read_known_hosts): clarify displayed value of unknown host key type.
  filevercmp: fix several unexpected results.
  tests/lib/strutil/filevercmp.c: use _GL_CMP() to get sign.
  tests/lib/strutil/filevercmp.c: minor improvements.
  Tests: clarification of boolean values tests.
  Tests clean up.
  (file_mask_dialog): refactoring: get rid of goto.
  (file_mask_dialog): NULLify variables before use in next iteration.
  (_str_convert): fix memory leak.
  Include <stddef.h> where ptrdiff_t is used.
  Ticket #4330: doc/INSTALL clean up.
  Update copyright years.
  Add script to update copyright years.
  ...
2022-03-13 13:37:09 +03:00
Andrew Borodin 037e04682c Update po/*.po files.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:36:45 +03:00
Andreas Mohr 1bdf814052 (mc_setup_by_args): reduce variable scope into #ifdef to fix coverity finding.
Found by Coverity.
Coverity id #331837

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:27 +03:00
Andrew Borodin 5b4ec9b033 (translate_file): refactoring.
Allocate buffer only if charset converter is created successfully.
g_string_free() returns NULL if second argument is TRUE. Use that to get
rig of 'if' statement.
Reduce variable scope.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:27 +03:00
Andrew Borodin a6c142ed48 (get_random_hint): refactoring.
g_string_free() returns NULL if second argument is TRUE. Use that to get
rig of 'if' statement.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:27 +03:00
Andrew Borodin c83f989a11 Fix coding style.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:27 +03:00
Andrew Borodin 4518885f93 (dir_list_load): rename argument: fltr -> filter.
(dir_list_reload): likewise.
(handle_dirent): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:27 +03:00
Andrew Borodin 2101026d4c (show_version): display version of libssh2.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:27 +03:00
Andrew Borodin bb42ed706c (sftpfs_read_known_hosts): clarify displayed value of unknown host key type.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:27 +03:00
Andrew Borodin 7408272361 filevercmp: fix several unexpected results.
Sync with gnulib 9f48fb992a3d7e96610c4ce8be969cff2d61a01b.
Problems reported by Michael Debertol in <https://bugs.gnu.org/49239>.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:27 +03:00
Andrew Borodin d00a1c22b9 tests/lib/strutil/filevercmp.c: use _GL_CMP() to get sign.
tests/lib/strutil/str_verscmp.c: likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:27 +03:00
Andrew Borodin 39e7a048f7 tests/lib/strutil/filevercmp.c: minor improvements.
Use ck_assert_int_lt() and ck_assert_int_gt() to check integer values.

Increase minimal version of Check up to 0.9.10.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:27 +03:00
Andrew Borodin 4f22598c9a Tests: clarification of boolean values tests.
Use mctest_assert_true and mctest_assert_false macros to check boolean
values.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:27 +03:00
Andrew Borodin f411d44fea Tests clean up.
Remove mc-specific macros mctest_assert_int_eq and mctest_assert_int_ne.
Use ck_assert_int_eq() and ck_assert_int_ne() functions respectively.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:27 +03:00
Andrew Borodin f0924b954d (file_mask_dialog): refactoring: get rid of goto.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:27 +03:00
Andreas Mohr 2087ede32d (file_mask_dialog): NULLify variables before use in next iteration.
Found by Coverity.
Coverity id #331828
Coverity id #331850

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:27 +03:00
Andrew Borodin 09de50d3a1 (_str_convert): fix memory leak.
Found by Coverity.
Coverity id #348334.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:26 +03:00
Andrew Borodin 9f53bf5617 Include <stddef.h> where ptrdiff_t is used.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:26 +03:00
Andrew Borodin 185c80ffb7 Ticket #4330: doc/INSTALL clean up.
Removed description of S-Lang related options that were removed
in 0a26014ca4.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:26 +03:00
Andrew Borodin 2c205c5928 Update copyright years.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:26 +03:00