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>
(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>
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>
...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>
* 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.
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>
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>
* 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.
...
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>
Sync with gnulib 9f48fb992a3d7e96610c4ce8be969cff2d61a01b.
Problems reported by Michael Debertol in <https://bugs.gnu.org/49239>.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
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>
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>