Commit Graph

15029 Commits

Author SHA1 Message Date
Andreas Mohr
1409eddde3 Ticket #3603: configure.ac: proper AC_INIT and AM_INIT_AUTOMAKE usage.
Fix deprecate warning
configure.ac:13: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated.  For more info, see:
configure.ac:13: http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation

Support of m4_esyscmd_s() since autoconf-2.64 (release 2009-07-26).

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-28 19:37:58 +03:00
Andrew Borodin
6a6fdf1ae3 Merge branch '4223_browse_jar'
* 4223_browse_jar:
  Ticket #4223: fix recognition of JAR files as ZIP archives
2021-03-28 19:32:38 +03:00
Piotrek Żygieło
0e023f0dd9 Ticket #4223: fix recognition of JAR files as ZIP archives
Similar to 7881ed2 that solved ticket #4180.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-28 19:30:11 +03:00
Andrew Borodin
fa2cbd2a2c Merge branch '4180_mc.ext_archives'
* 4180_mc.ext_archives:
  Ticket #4180: reorgzanize mc.ext.
2021-03-28 19:19:16 +03:00
Andrew Borodin
c3848a689c Ticket #4180: reorgzanize mc.ext.
$ file -L image.zip
image.zip: Zip archive data, at least v2.0 to extract
$ file -L -z image.zip
image.zip: JPEG image data, JFIF standard 1.01, resolution (DPI),
density 96x96, segment length 16, baseline, precision 8, 1024x768,
frames 3 (Zip archive data, at least v2.0 to extract)

Since in mc.ext

type/^JPEG

is evaluated before

type/\(Zip archive

mc assume image.zip is a image not an archive.

To solve this, since we use "file -z", match file name at first
(regex/ and shell/), then type/.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-28 15:36:42 +03:00
Andrew Borodin
6d67058499 Merge branch '4217_remove_distro_specific_stuff'
* 4217_remove_distro_specific_stuff:
  Ticket #4217: remove OS/distro-specific stuff.
2021-03-21 20:32:28 +03:00
Andrew Borodin
63d50df5d9 Ticket #4217: remove OS/distro-specific stuff.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-21 20:30:30 +03:00
Andrew Borodin
3ba4229508 (do_panelize_cd): fix memory leak.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-18 16:41:36 +03:00
Andrew Borodin
11ed948f02 (do_find): fix wrong duplication of file name.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-18 16:39:31 +03:00
Andrew Borodin
4df5bbf9ef Fix indentation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 20:15:00 +03:00
Andrew Borodin
f223210dcd Merge branch '4179_cleanup'
* 4179_cleanup: (38 commits)
  Update po/*.po files.
  libcheck: replace deprecated fail_unless() function.
  libcheck: replace deprecated fail() function.
  (hex_translate_to_regex.c): fix maybe-uninitialized warning.
  Fix lto-type-mismatch warning.
  (rotate_dash): type accuracy.
  (widget_set_size): call widget_draw() to get rid of code duplication.
  (mc_g_string_dup): new API that extends GString one.
  (file_entry_t): use GString instead of fname & fnamelen.
  (vfs_path_free): add 2nd parameter...
  (init_subshell_child): use g_setenv() instead of putenv().
  Define macros for bashrc, ashrc, and inputrc files.
  Refactoring of keymap load/save.
  (struct key_config_t): remove.
  (struct name_keymap_t): move from lib/keybind.h to lib/keybind.c.
  (mc_tmpdir): use $MC_TMPDIR if set.
  (show_file_history): keep order of modified history items.
  filemanager/chattr.c: remove TODO.
  Clarify check of 256 colors support.
  Ticket #4173: fix linking of libmc.la.
  ...
2021-03-14 20:03:20 +03:00
Andrew Borodin
bb51da6590 Update po/*.po files.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 20:02:52 +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
ca126b3f69 (rotate_dash): type accuracy.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:57:24 +03:00
Andrew Borodin
4faf4cb2d7 (widget_set_size): call widget_draw() to get rid of code duplication.
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
6903d15b97 (init_subshell_child): use g_setenv() instead of putenv().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:52:38 +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
269ace6bf2 Refactoring of keymap load/save.
src/keymap.[ch]: rename from src/keybind-defaults.[ch].

(keymap_load): rename from load_keymap_defs().
(keymap_free): rename from free_keymap_defs().

Move keymap load/save functions from src/setup.c to src/keymap.c.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:48:59 +03:00
Andrew Borodin
2ab7fd0390 (struct key_config_t): remove.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:48:59 +03:00
Andrew Borodin
fb3ea27299 (struct name_keymap_t): move from lib/keybind.h to lib/keybind.c.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:48:59 +03:00
Andrew Borodin
faa195ae59 (mc_tmpdir): use $MC_TMPDIR if set. 2021-03-14 19:48:59 +03:00
Andrew Borodin
7b5b56104b (show_file_history): keep order of modified history items.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:48:59 +03:00
Andrew Borodin
48dea680e6 filemanager/chattr.c: remove TODO.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:48:59 +03:00
Andrew Borodin
4cbc61a775 Clarify check of 256 colors support.
(tty_use_truecolors): don't check 256 colors here.
(tty_use_256colors): generate error message if 256 colors aren't
supported.
(tty_init): sync with modified tty_use_256colors().
(tty_color_try_alloc_pair_lib): likewise.
(mc_skin_init): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:48:59 +03:00
Andrew Borodin
f29533f00f Ticket #4173: fix linking of libmc.la.
Thanks Sebastian Gniazdowski <sgniazdowski@gmail.com> for the issue.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:48:59 +03:00
Andrew Borodin
32cc3532a9 doc: fix autotools and gettext versions.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:48:59 +03:00
Andrew Borodin
7acf07ee6e (str_convert_to_input): make inline.
(str_convert_to_display): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:30:42 +03:00
Andrew Borodin
f5b813a0ab undelfs simplifications.
m4.include/vfs/mc-vfs-undelfs.m4: simplify test of required libraries.
Don't test Linux kernel specific header.

src/vfs/undelfs/undelfs.c: don't include Linux kernel specific header.
Use headers from ext2fs library only.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:30:42 +03:00
Andrew Borodin
5a4d1dd122 src/args.c: fix formatting.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:30:42 +03:00
Andrew Borodin
f4b1c0a4d0 (parse_256_or_true_color_name): pacify gcc-10.2.
Fix warnings:

lib/tty/color-internal.c: In function 'tty_color_get_index_by_name':
lib/tty/color-internal.c:156:19: warning: '[0]' may be used uninitialized in this function [-Wmaybe-uninitialized]
  156 |             i = (h[0] << 20) | (h[1] << 16) | (h[2] << 12) | (h[3] << 8) | (h[4] << 4) | h[5];
      |                  ~^~~
lib/tty/color-internal.c:156:34: warning: 'h[1]' may be used uninitialized in this function [-Wmaybe-uninitialized]
  156 |             i = (h[0] << 20) | (h[1] << 16) | (h[2] << 12) | (h[3] << 8) | (h[4] << 4) | h[5];
      |                                 ~^~~
lib/tty/color-internal.c:156:49: warning: 'h[2]' may be used uninitialized in this function [-Wmaybe-uninitialized]
  156 |             i = (h[0] << 20) | (h[1] << 16) | (h[2] << 12) | (h[3] << 8) | (h[4] << 4) | h[5];
      |                                                ~^~~

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:30:42 +03:00
Andrew Borodin
452074906a (str_replace_all): use g_ptr_array_new_with_free_func().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:30:42 +03:00
Andrew Borodin
a309e1e133 (str_ptr_array_join): return GString.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:30:42 +03:00
Andrew Borodin
6af68462dd Sync with gnulib 1b357ec51ac32ebc6262373a354ffd33e5bba8c0.
Remove some of the support for obsolete IRIX 4 and 5.

* m4.include/gnulib/mountlist.m4 (AC_FUNC_GETMNTENT): Don't test for
getmntent in libsun.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:30:42 +03:00
Andrew Borodin
f469197c79 (edit_get_macro): refactoring.
Return position of found macro in global variable macro_list or -1 if
nothing found.

(edit_delete_macro): related changes.
(edit_execute_macro): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:30:42 +03:00
Andrew Borodin
fdd3a0013f (edit_repeat_macro_cmd): refactoring.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:30:42 +03:00
Andrew Borodin
d650faf774 (edit_load_macro_cmd): refactoring.
Get rid of create and free of an empty array. Create macros array if
needed.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:30:42 +03:00
Andrew Borodin
3e8ca53fa2 (edit_load_macro_cmd): fix memory leaks.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:30:42 +03:00
Andrew Borodin
ef45037919 (edit_store_macro_cmd): refactoring.
Get rid of create and free of an empty array and string. Create macros
array and string if needed.

Fix typo.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:30:42 +03:00
Andrew Borodin
985bef8c6d (edit_store_macro_cmd): fix memory leak.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:30:42 +03:00
Andrew Borodin
daf21d8315 Clarify init and destroy of dialog.
(group_default_callback): NULLify list of widgets after destroy.

(dlg_default_callback): do nothing in MSG_INIT and MSG_DESTROY handlers.

(dlg_destroy): send MSG_DESTORY to dialog to allow it destroy it's
private data. MSG_DESTROY is a last message sent to dialog before
desctuction.

(edit_dialog_callback): use MSG_DESTROY instead of MSG_END to deinit
editor.

(midnight_callback): use MSG_DESTROY instead of MSG_DESTORY to deinit
file manager.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:30:42 +03:00
Andrew Borodin
c96875fa9f Fix typo.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:30:42 +03:00
Andrew Borodin
cf54c9457a doc/NEWS: cosmetics. 2021-03-14 19:30:42 +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
318981535f Merge branch '4191_tar.xz'
* 4191_tar.xz:
  (open_error_pipe, close_error_pipe): remove.
  (extfs_read_archive): move file adding to separate function.
  extfs: reimplement using mc_pipe.
  (sfs_vfmake): reimplement using mc_pipe.
  (do_external_panelize): reimplement using mc_pipe.
  (mc_pstream_get_string): new API.
  (mc_popen): add two parameters:
  Ticket #4191: unable to browse tar.xz archives.
2021-03-14 19:17:27 +03:00