Commit Graph

251 Commits

Author SHA1 Message Date
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 2c205c5928 Update copyright years.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:26 +03:00
Andrew Borodin 89d8fa4ac1 Ticket #1: remove SMB suport.
The mc's built-in samba library which is used to access data across
smb links is taken from an old samba version.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-09-26 10:03:49 +03:00
Andrew Borodin b77961a14d mcedit: move all completion-related stuff to editcomplete.[ch].
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 16:16:45 +03:00
Andrew Borodin de16ae9180 Use G_OPTION_ENTRY_NULL macro.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:56 +03:00
Andrew Borodin 2cd33ad0d5 Convert widget coordinates from global to local and vice versa.
Add two widget callbacks:
  * (make_global): convert widget coordinates from local (relative to
    owner) to global (screen).
  * (make_local): convert widget coordinates from global (screen) to
    local (relative to owner).

Such conversions are required when nested widgets and groups are added to
or removed from another groups.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:56 +03:00
Andrew Borodin 4df5bbf9ef Fix indentation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 20:15:00 +03:00
Andreas Mohr fa8c5e1c37 libcheck: replace deprecated fail_unless() function.
libcheck fail_unless() is deprecated since 0.10.0.
Also fix -Wformat-extra-args warnings.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:57:25 +03:00
Andreas Mohr da97a2a626 libcheck: replace deprecated fail() function.
libcheck fail() is deprecated since 0.10.0.
Also fix -Wformat-extra-args warnings.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:57:25 +03:00
Andreas Mohr 79fb2be8d1 (hex_translate_to_regex.c): fix maybe-uninitialized warning.
hex_translate_to_regex.c: In function 'test_hex_translate_to_regex_fn':
hex_translate_to_regex.c:172:9: error: 'error' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  172 |         mctest_assert_int_eq (error, data->expected_error);
      |         ^
hex_translate_to_regex.c:154:33: note: 'error' was declared here
  154 |     mc_search_hex_parse_error_t error;
      |                                 ^

Found by gcc-9.3.0

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:57:24 +03:00
Andreas Mohr 7b9c9564e8 Fix lto-type-mismatch warning.
Found by gcc-9.3.0.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:57:24 +03:00
Andrew Borodin d88f439a69 (mc_g_string_dup): new API that extends GString one.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:57:24 +03:00
Andrew Borodin 6f859e52d0 (file_entry_t): use GString instead of fname & fnamelen.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:52:39 +03:00
Andrew Borodin 536fb676d8 (vfs_path_free): add 2nd parameter...
...to free or not to free the string representation
of vfs_path_t object.

It allows to get rid of string duplication in following cases:

vfs_path_t *vpath;
char *path;
...
vpath = vfs_path_from_str (...);
path = g_strdup (vfs_path_as_str (vpath));
vfs_path_free (vpath);

Now we can write:

vfs_path_t *vpath;
char *path;
...
vpath = vfs_path_from_str (...);
path = vfs_path_free (vpath, FALSE);

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:52:39 +03:00
Andrew Borodin 0c02118fad Define macros for bashrc, ashrc, and inputrc files.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:52:38 +03:00
Andrew Borodin 9ee52e77c3 Ticket #4179: code clean up before 4.8.27 release.
Update copyright years.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:30:42 +03:00
Andrew Borodin a10bf6a244 (mc_pstream_get_string): new API.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:17:08 +03:00
Andrew Borodin 6cc697beff Add test for new ftp parser.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:02:12 +03:00
Andrew Borodin 76847e08fd Ticket #4203: support custom .zshrc.
Custom .zshrc file is  ~/.local/share/mc/.zshrc.

If ZDOTDIR environment variable is not set, set it to ~/.local/share/mc
if a .zshrc is found there. It is the only way to point zsh to an other
rc file than the default.

Thanks Sebastian Gniazdowski <sgniazdowski@gmail.com> for the original
patch.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-13 20:17:31 +03:00
Andrew Borodin 285eb5c186 Ticket #3682: drop automatic migration of configuration
...from ~/.mc to XDG-base.

Now MC ignores ~/.mc directory and uses XDG-based only.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-02-22 21:16:52 +03:00
Andrew Borodin ba6b42802f Ticket #4154: support unrar v6.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-02-13 16:52:07 +03:00
Andreas Mohr 631cf4f3bf Ticket #3986: tests: do not write parallel to logfile.
Since automake-1.12 (test-driver script) libcheck logfile is written
parallel by automake.
Print test logging to stdout and let write to logfile by automake only.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-02-07 20:58:45 +03:00
Andrew Borodin 2420b7180b editor: completing from all open files.
Thanks Sebastian Gniazdowski <sgniazdowski@gmail.com> for the original
patch.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-02-07 20:37:36 +03:00
Andrew Borodin 29720d04ab editor: word completion: refactoring.
(edit_collect_completions): return GQueue. Use GQueue inside.
Do not return an empty queue, create it if needed only.

(edit_complete_word_cmd): Use GQueue inside. Ged rid of limitation
of completions count. Rename variable.

(editcmd_dialog_completion_show): take GQueue. Rename and reorder
arguments.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-02-07 20:37:13 +03:00
Andrew Borodin c1ed403c02 tests/lib/strutil/Makefile.am: remove unsed include path.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andrew Borodin d37dbcca4c Move cd_to() to separate file.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andrew Borodin 344af14029 Refactoring: rename functions
_do_panel_cd -> panel_do_cd_int
do_panel_cd -> panel_do_cd
do_cd -> panel_cd
do_cd_command -> cd_to

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andrew Borodin e3519f8966 (do_cd_command): refactoring: get path only
...instead of command "cd path".

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andrew Borodin 6f96cad1ca (examine_cd): return GString.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andrew Borodin 819e0908f6 src/filemanager/ext.c: minor refactoring.
(exec_get_export_variables): return GString.
(exec_make_shell_string): likewise.
(exec_extension): exec_get_export_variables() and
exec_make_shell_string() retur GString now.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andrew Borodin 0e272b9e90 (do_cd): get rid of global variable current_panel usage...
...and related changes.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andrew Borodin 41a35b9b8a Rename files:
src/filemanager/midnight.[ch] -> src/filemanager/filemanager.[ch].

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andrew Borodin 78893d85b8 Drop mc_timer. Use g_get_real_time() instead.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-12 20:39:01 +03:00
Andrew Borodin fc26346cdb tests: extfs/zip: file names with leading space or dash.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-11-21 14:48:06 +03:00
Andrew Borodin 03b9af4e5d Revert "urar extfs: don't start path with ./ in file list."
This reverts commit 6dc337ff90.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-11-21 14:48:06 +03:00
Andrew Borodin b814b3dd02 extfs/uzip: add leading ./ to file name
...to handle files with name started with space or dash.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-11-21 14:48:06 +03:00
Andrew Borodin 562889ce1e Rename macro MC_SKINS_SUBDIR to MC_SKINS_DIR.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andrew Borodin b65a951ee4 Clean up files unused by mcedit anymore.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andrew Borodin 81b1f47e01 Rename macros with editor-related file locations.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andrew Borodin a94dd7d2de VFS GC: use mc_timer.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:18 +03:00
Andrew Borodin e9d23e90f0 Find widget API: support groups.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-03-08 20:13:33 +03:00
Andrew Borodin fdf3d9c3b7 WGroup: implement init & destroy.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-03-08 20:12:45 +03:00
Andrew Borodin 31b37a1f79 Ticket #4050: code cleanup before 4.8.25 release.
Update copyright years.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-02-29 19:10:17 +03:00
Andrew Borodin 851d2022a9 (hotkey_equal): new hotkey API.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-12-15 13:02:31 +03:00
Andrew Borodin 68d9961977 Ticket #4022: fix compile failure on AIX 7.2.
Rename MC VFS flags to avoid name conflicts with system-wide VFS flags
on some OSes (such as AIX).

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-11-18 21:27:56 +03:00
Andrew Borodin 6dc337ff90 urar extfs: don't start path with ./ in file list.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-09-29 15:11:53 +03:00