Commit Graph

6403 Commits

Author SHA1 Message Date
Andrew Borodin
cac689a81a Get rid of extra update of mini info.
(stop_search): don't update mini info if quick search is incative.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 14:57:43 +03:00
Andrew Borodin
d19b247c6d Ticket #4384: fix accelerator conflict in Left/Right menu.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 14:57:43 +03:00
Andrew Borodin
a3d323c6b3 Ticket #3887: (handle_console_linux): fix endianness bug.
handle_console_linux() passes the address of action to write() and intends
to send one byte of data (the LSB). On LE this works, but one BE machines
this sends the MSB which is always zero. Fix this by assigning the value
first to a char type, and use that instead.

Thanks Sven Schnelle <svens@stackframe.org> for the original patch.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-11-21 14:49:46 +03:00
Andrew Borodin
f1e2f0e93d Ticket #4150: support file/dir macros for standalone mcviewer.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-10-31 09:49:45 +03:00
Andrew Borodin
8b79bfe32d (free_erase_list): test queue before free.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-10-02 11:41:07 +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
c3ba19b422 (sftpfs_chmod): set permissions only, don't touch other attributes.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-09-11 20:34:21 +03:00
Andrew Borodin
8e5f8255e1 Ticket #4285: sftp: timestamps are not preserved for uploaded symlink.
* (sftpfs_symlink): don't call sftpfs_fix_filename() for target file
    bacause it breaks symlink: relative symlinks became an absolute one.
  * (sftpfs_utime): set timestamps only, don't touch other attributes.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-09-11 20:24:30 +03:00
Andrew Borodin
399f25fe9f Ticket #4281: fish upload: symbolic link along with its target.
fish/utime: use `touch -h` to change the times of the link itself
rather than the file that the link points to. -h implies -c
and thus will not create any new files.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-09-11 09:37:55 +03:00
Andrew Borodin
1b39025049 Ticket #4287: file move across filesystems is slow.
src/filemanager/file.c: reimplement erase_list using GQueue instead of
GSlist to get rid of walk each time through the whole linked list.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-09-05 11:39:42 +03:00
Andrew Borodin
e7bbf72544 Ticket #4200: fix FTBFS with ncurses build with --disable-widec.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-08-28 11:46:53 +03:00
Sergey Larin
2234fd8357 Ticket #4269: (edit_close_cmd): fix use-after-free.
The old 'w' pointer became invalid after widget_destroy() call, so we need
to get the new widget directly after find_editor.

Found using PVS-Studio 7.14 with intermodular analysis mode.

Signed-off-by: Sergey Larin <cerg2010cerg2010@mail.ru>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-08-09 21:29:23 +03:00
Andrew Borodin
9235d3c232 SFTPFS: verify server fingerprint (fix CVE-2021-36370).
Use ~/.ssh/known_hosts file to verify server fingerprint
using ssh way:

$ ssh localhost
The authenticity of host 'localhost (127.0.0.1)' can't be established.
ED25519 key fingerprint is SHA256:FzqKTNTroFuNUj1wUzSeV2x/1lpcESnT0ZRCmq5H6o8.
Are you sure you want to continue connecting (yes/no)? no
ssh: Host key verification failed.

$ ssh localhost
The authenticity of host 'localhost (127.0.0.1)' can't be established.
ED25519 key fingerprint is SHA256:FzqKTNTroFuNUj1wUzSeV2x/1lpcESnT0ZRCmq5H6o8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (ED25519) to the list of known hosts.
andrew@localhost's password:

Thanks the Curl project for the used code.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Yury V. Zaytsev <yury.zaytsev@moneymeets.com>
2021-07-26 20:34:17 +03:00
Andrew Borodin
fdd6706245 (sftpfs_open_connection): handle EAGAIN for libssh2_session_handshake().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-07-26 20:34:17 +03:00
Andrew Borodin
b0450a1e18 Ticket #4259: SFTPFS VFS: verify server fingerprint (CVE-2021-36370).
This vulnerability was discovered by AUT-milCERT during an audit of open
source software.

Initial changeset: set minimal version of libssh2 to 1.2.8.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-07-26 20:33:48 +03:00
m_ok
36e48b04bd Ticket #4260: ftpfs: the month of file is always January.
(parse_ls_line): fix test of vfs_parse_month() value.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-07-13 21:32:35 +03:00
Eric Roberts
e89713a3d6 Ticket #4198: MC hangs on start randomly with zsh as subshell.
The bug happens because MC tells the shell to perform a "cd" command,
and waits indefinitely for the command to complete. If the shell, for
some reason, cannot complete the "cd" command, MC just freezes
indefinitely.

This patch removes all instances of MC waiting indefinitely for "cd"
commands. Now, if the shell freezes while doing a "cd", MC will timeout
after 1 second, and just set the subshell state to ACTIVE. If the user
tries to run a command, they will get the error "The shell is already
running a command".

Some other stuff where MC waits on the shell if an error occurred is
also simplified.

In feed_subshell(), the timeout time is changed from 10 seconds to
1 second. Ten seconds seemed like far too long to wait.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-07-04 19:06:28 +03:00
Andrew Borodin
0e6721c32b Ticket #4213: workaround to avoid crash on FreeBSD.
Previous fix 443a8106f1
makes the command line inaccessible if mc runs with
disabled subshell (mc -u).

This commit fixes the command line.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-07-03 18:59:38 +03:00
Andrew Borodin
7ef1925a98 (render_edit_text): fix endless loop.
Thanks Sebastian Gniazdowski <sgniazdowski@gmail.com> for the issue.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-27 15:02:49 +03:00
Andrew Borodin
eb58d94341 src/filemanager/mountlist.c: recognize fuse.portal as dummy file system.
Sync with gnulib 9a38d499ca16f2f4304992eb1ab0894cd0b478e1.

Add "fuse.portal" as a dummy file system (used in flatpak
implementations).

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 16:16:46 +03:00
Andrew Borodin
25e419ba08 (check_dir_is_empty): minor optimization.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 16:16:45 +03:00
Andrew Borodin
437994eb80 (do_move_dir_dir): remove unused variable.
Variable calc_total is set but isn't read.

Found by Andreas Mohr <and@gmx.li>.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 16:16:45 +03:00
Andrew Borodin
106d95229f (sftpfs_open_file): don't destroy file handler here.
Fix Coverity id #331814.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 16:16:45 +03:00
Andreas Mohr
10c27b28a7 (load_group): fix use after free.
Found by Coverity.
Coverity id #331812.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 16:16:45 +03:00
Andreas Mohr
c15b752fbf (exec_extension): fix memory leak.
Found by Coverity.
Coverity id #331829.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 16:16:45 +03:00
Andreas Mohr
4db80f3010 (dir_list_reload): fix resource leak.
Found by Coverity.
Coverity id #331809.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 16:16:45 +03:00
Andrew Borodin
5b7b48e1db mcedit: move macros-related stuff to editmacros.[ch].
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 16:16:45 +03:00
Andrew Borodin
0df10f488b (extfs_open_archive): fix NULL dereferences.
Fix passing NULL pointer "tmp" to g_strconcat().

Found by Coverity.
Coverity is #331840.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 16:16:45 +03:00
Andrew Borodin
2d4008655e (exec_make_shell_string): simplify condition, reduce variable scope.
Fix Coverity id #331832.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 16:16:45 +03:00
Andrew Borodin
69b8927ec9 (panel_recursive_cd_to_parent): fix memory leak.
Found by Coverity.
Coverity id #331846.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 16:16:45 +03:00
Andreas Mohr
4070d7bee5 (apply_rules_going_right): fix deadcode.DeadStores warning.
syntax.c:523:25: warning: Value stored to 'found_right' is never read [deadcode.DeadStores]
                        found_right = TRUE;
                        ^             ~~~~

Found by Clang-11 analyzer.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 16:16:45 +03:00
Andreas Mohr
337da4491d (edit_replace_cmd): fix deadcode.DeadStores warning.
editsearch.c:915:13: warning: Value stored to 'i' is never read [deadcode.DeadStores]
            i = edit->found_len = len;
            ^   ~~~~~~~~~~~~~~~~~~~~~

Found by Clang-11 analyzer.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 16:16:45 +03:00
Andreas Mohr
9b752e3a2f (edit_draw_this_line): fix deadcode.DeadStores warning.
editdraw.c:536:5: warning: Value stored to 'color' is never read [deadcode.DeadStores]
    color = edit_get_syntax_color (edit, b - 1);
    ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Found by Clang-11 analyzer.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 16:16:45 +03:00
Andrew Borodin
22a7ef782d (edit_do_search): search descriptor should not be NULL.
Fix of Coverity id #110818.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 16:16:45 +03:00
Andrew Borodin
a7b8d00535 (background_attention): don't use bad file descriptor.
Found by Coverity.
Coverity id #32593.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 16:16:45 +03:00
Andrew Borodin
830d6c2d48 (editcmd_dialog_raw_key_query): move to editcmd.c.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 16:16:45 +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
21eefb3e36 mcedit: move all etags-related stuff to tags.[ch].
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:56 +03:00
Andrew Borodin
3a8f21166b (edit_buffer_find_word_start): rename from edit_find_word_start
...and move to editbuffer.c.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:56 +03:00
Andrew Borodin
9094cdd1d3 mcedit: move content of choosesyntax.c to syntax.c.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:56 +03:00
Andrew Borodin
c6bdc7c1dc mcedit: move all spell-related stuff to spell.[ch].
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:56 +03:00
Andrew Borodin
3b34936b9f mcedit: move all search&replace-related stuff to editsearch.[ch]. 2021-06-20 15:14:56 +03:00
Andrew Borodin
9d4eb459da (edit_search_cmd): clarify handling of NULL item of history.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:56 +03:00
Andrew Borodin
7bc1b19676 (edit_search_cmd): get rid of code duplication.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:56 +03:00
Andrew Borodin
21feb38a8d mcedit: refactoring of search.
(edit_search_init): new function: initialization of search handler.
(edit_search_deinit): new function: deinitialization of search handler.
(edit_replace_cmd): use edit_search_init().
(edit_search_cmd): likewise.
(editcmd_dialog_search_show): use edit_search_init() and
edit_search_deinit().
(edit_search_options): move definition from editcmd_dialogs.c to editsearch.c.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:56 +03:00
Andrew Borodin
288fe62987 (mcview_continue_search_cmd): clarify handling of NULL item of history. 2021-06-20 15:14:56 +03:00
Andrew Borodin
6adcd57859 (mcview_continue_search_cmd): get rid of string duplication.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:56 +03:00
Andrew Borodin
1fa327c5a1 (mcview_continue_search_cmd): get rid of code duplication.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:56 +03:00
Andrew Borodin
65ca3da3b2 mcviewer: refactoring of search.
(mcview_search_init): new function: initialization of search handler.
(mcview_search_deinit): new function: deinitialization of search handler.
(mcview_dialog_search): use mcview_search_init() and mcview_search_deinit().
(mcview_continue_search_cmd): use mcview_search_init().
(mcview_dialog_search): use mcview_search_deinit().
(mcview_search_options) move definition from dialogs.c to search.c.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:56 +03:00
Andrew Borodin
37b86b2781 (extfs_open_and_read_archive): fix NULL dereference in mc_plose().
Found by Coverity.
Coverity id #331765.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:56 +03:00
Andrew Borodin
45a4d3f6d4 mcviewer: move content of inlines.h into internal.h.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:56 +03:00
Andrew Borodin
91b7101e06 (DOZ): new macro: difference or zero.
Use DOZ where appropriate.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:56 +03:00
Andrew Borodin
d35df9ad60 Use argument names in function declarations.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:56 +03:00
Andrew Borodin
721048161c (extfs_get_plugins): use is_exe().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:56 +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
f657d92e52 (execute_menu_command): fix memory leak.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:56 +03:00
Fredrik Fornwall
ded5d37ff0 MidnightCommander/#113: replace S_IWRITE with S_IWUSR.
S_IWRITE is an obsolete synonym provided for BSD compatibility.
It can be safely replaced with S_IWUSR.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:56 +03:00
Andrew Borodin
558fb350f8 (tar_fill_stat): fix signedness change.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:56 +03:00
Andrew Borodin
231c84caeb Widget: implement destroy callback.
(dlg_destroy): remove. Use widget_destroy() to destroy any dialog.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:56 +03:00
Andrew Borodin
e7fab254f9 Rename variable: midnight_dlg -> filemanager.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:56 +03:00
Andrew Borodin
1e1cbb31d0 src/filemanager/chattr.c: minor refactoring.
(chattrboxes_new): create WChattrBoxes widget entirely.
(chattr_dlg_create): move creation of checkboxes to chattrboxes_new().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:56 +03:00
Andrew Borodin
ba890d9a92 (make_symlink): take paths as vfs_path_t objects
...to get rid of extra type conversions.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:56 +03:00
Andrew Borodin
6596185573 (sftpfs_fix_filename): return pointer to GString instead of pointer to char.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:55 +03:00
Andreas Mohr
b71f66dbbd Fix const/unconst casts.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:55 +03:00
Andrew Borodin
0718ef89f7 man2hlp: limited support of \(lq, \(rq and \(dq commands.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:55 +03:00
Andrew Borodin
c2a17d3a99 (repaint_file): remove mv argument.
mv is always the inversion of isstatus.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:55 +03:00
Andreas Mohr
8d84972533 (extfs_get_archive_name): fix -Wcast-qual warning.
extfs.c:799:24: warning: cast from 'const struct extfs_super_t *' to 'struct vfs_s_super *' drops const qualifier [-Wcast-qual]
        archive_name = VFS_SUPER (archive)->name;
                       ^
../../../lib/vfs/xdirentry.h:39:46: note: expanded from macro 'VFS_SUPER'
#define VFS_SUPER(a) ((struct vfs_s_super *) (a))
                                             ^

Found by Clang-11

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:55 +03:00
Andreas Mohr
108c465176 (overwrite_query_dialog): fix -Wcast-qual warnings.
filegui.c:531:19: warning: cast from 'const char *' to 'char *' drops const qualifier [-Wcast-qual]
    s1 = (char *) file_date (ui->src_stat->st_mtime);
                  ^
filegui.c:546:19: warning: cast from 'const char *' to 'char *' drops const qualifier [-Wcast-qual]
    s1 = (char *) file_date (ui->dst_stat->st_mtime);
                  ^

Found by Clang-11.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:55 +03:00
Andreas Mohr
34616d6444 src/filemanager/chattr.c: fix -Wcast-qual warnings.
chattr.c:398:34: warning: cast from 'const struct WChattrBoxes *' to 'struct WGroup *' drops const qualifier [-Wcast-qual]
    w = WIDGET (g_list_nth_data (GROUP (cb)->widgets, Id - cb->top));
                                 ^
../../lib/widget/group.h:16:29: note: expanded from macro 'GROUP'
#define GROUP(x) ((WGroup *)(x))
                            ^
chattr.c:515:27: warning: cast from 'const struct WChattrBoxes *' to 'struct WGroup *' drops const qualifier [-Wcast-qual]
    for (i = cb->top, l = GROUP (cb)->widgets; l != NULL; i++, l = g_list_next (l))
                          ^
../../lib/widget/group.h:16:29: note: expanded from macro 'GROUP'
#define GROUP(x) ((WGroup *)(x))
                            ^

Found by Clang-11

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:55 +03:00
Andrew Borodin
443a8106f1 Ticket #4213: workaround to avoid crash on FreeBSD.
In the read_subshell_prompt() (src/subshell/common.c:1546) the first
call of select() returns 0. Therefore subshell_prompt is NULL.
NULL dereference is the cause of crash.

This commit isn't a real fix but just a workaround.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 14:59:59 +03:00
Andrew Borodin
0cb6e97230 (execute_menu_command): get rid of code duplication.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-05-23 10:49:10 +03:00
Lukasz Krotowski
72d2fb981a Ticket #4242: %view fails to execute on no-exec tmp filesystem.
(execute_menu_command): use indirect execution of %view.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-05-23 10:49:10 +03:00
Andrew Borodin
0375997c78 Ticket #4244: fix segfault on dialog before panels get visible.
If some small dialog (error message or password request) is displayed
before main mc window gets visible, the segfault occures.

The cause of segfault is update of prompt that is not created yet.

(setup_mc, create_file_manager): move creation of event channel from
setup_mc() to create_file_manager(), make that after creation of all
file manager widgets.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-05-18 10:23:08 +03:00
MooSE
779f30c39f Ticket #4239: extfs/u7z: support official 7z binary (7zz).
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-05-08 16:29:33 +03:00
Andrew Borodin
8c92bec6eb Modify editor refcounter
...to fix segault introduced in daf21d8315.

Both actions MSG_INIT and MSG_DESTROY should be send to widget. In editor,
if file cannot be open, MSG_INIT isn't sent to, but MSG_DESTROY is. As a
result, a double free is occured in edit_dlg_deinit().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-04-30 08:54:52 +03:00
Andrew Borodin
789aa0bb22 (setup_panels): reduce the number of redraws.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-04-11 17:10:14 +03:00
Andrew Borodin
57fd21c7a0 (setup_panels, setup_cmdline): use WST_VISIBLE to set up prompt and command line.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-04-11 17:10:13 +03:00
Andrew Borodin
9ac272a287 (setup_panels): use WST_VISIBLE to set up hint bar.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-04-11 17:10:13 +03:00
Andrew Borodin
913403b10c Buttonbar: use WST_VISIBLE state
...instead of WButtonBar::visible member.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-04-11 17:10:08 +03:00
Andrew Borodin
0e75e85598 Menubar: use WST_VISIBLE state
...instead of WMenuBar::is_visible member.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-04-11 17:09:53 +03:00
Andrew Borodin
32621b96d1 Ticket #2252: reduce rebuld time.
The build system runs configure script after switching to another branch
or changeset, which basically means that each git operation which
modifies HEAD will cause a full rebuild. This is highly annoying, in
particular during bisecting.

Solution:
Don't define version in config.h.
Add mc_version member to mc_global_t structure and use it instead of
VERSION macro.
Now only lib/global.c depends on MC version.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-04-11 16:58:31 +03:00
Andrew Borodin
14e84cbf8e Preserve timestamp for other file types: socket, fifo, etc.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-04-04 10:20:50 +03:00
Andrew Borodin
109af564bc Ticket #3985: preserve timestamp for synlinks.
* (local_utime): pass AT_SYMLINK_NOFOLLOW to utimensat() to update
    timestamps of the link,  rather  than the file to which it refers.
  * (move_file_file): preserve timestamp of the link.
  * (copy_file_file): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-04-03 16:15:44 +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
ca126b3f69 (rotate_dash): type accuracy.
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
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
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
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
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
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
68fe37d339 (extfs_read_archive): move file adding to separate function.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:17:08 +03:00
Andrew Borodin
0781c4fb6d extfs: reimplement using mc_pipe.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:17:08 +03:00
Andrew Borodin
e36158b02b (sfs_vfmake): reimplement using mc_pipe.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:17:08 +03:00
Andrew Borodin
c8f4a80ac8 (do_external_panelize): reimplement using mc_pipe.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:17:08 +03:00
Andrew Borodin
1e45efecb2 (mc_popen): add two parameters:
do or don't read stdout of child process;
do or don't read stderr of child process.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:17:07 +03:00
Andrew Borodin
dc8db0089f ftpfs: use new parser.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:02:12 +03:00
Andrew Borodin
d4cbed25cc (parse_ls_line): get rid of extra string duplication.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:02:12 +03:00
Andrew Borodin
804186bbd8 Add ftp long file list parser from lftp and modify it for MC VFS.
Based on lftp 62093f21348be405fdefbd10d4655a224f326153.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:02:12 +03:00
Andrew Borodin
9c7437bf48 etags: get rid of limitation of window width.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-13 20:35:56 +03:00
Andrew Borodin
451e1585a7 etags: get rid of limitation of definition length.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-13 20:35:56 +03:00
Andrew Borodin
ce05476057 etags: get rid of limitation of list length.
(etags_set_definition_hash): return GPtraArray.
(editcmd_dialog_select_definition_show): take GPtraArray.
(edit_get_match_keyword_cmd): sync with modified functions.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-13 20:35:56 +03:00
Andrew Borodin
f82d30e3e0 etags: fix memory leaks.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-13 20:35:56 +03:00
Andrew Borodin
68c9db0c17 (etags_hash_t): remove unused filename_len member.
Cleanup unused includes.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-13 20:35:56 +03:00
Andrew Borodin
4a3cf4c6af Ticket #4132: clarify width of 'Find declaration' dialog.
Initial changeset:
src/editor/etags.[ch]: fix coding style.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-13 20:35:56 +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
Sebastian Gniazdowski
360e9bec33 Ticket # 4207: (editcmd_dialog_select_definition_show): fix "Find declaration" disrupting file's path.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-02-28 16:50:39 +03:00
Andrew Borodin
1ed638d66c Ticket #4180: fix zip handling.
After 8857423e4e zip archives opened with
an error:

    file -L -z archive.zip: Bad system call

This caused by using /usr/bin/file with -z option, because seccomp (a
security sandbox) doesn't allow it..

Solution: use -S option together with -z one.

The file command accepts the -S option since 5.33.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-02-28 16:39:21 +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
Paul Sokolovsky
1d1dba440d Ticket #2020: filemanager/find.c: implement "Follow symlinks" option.
Add "Follow symlinks" checkbox. Default state is off (following
current hardcoded behavior).

Signed-off-by: Paul Sokolovsky <pfalcon@users.sourceforge.net>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-02-22 21:09:17 +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
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
3b476adcae editor: word completion: refactoring.
(edit_collect_completion_from_one_buffer): new function. Main loop of
completion searching is here now.

(edit_collect_completions): use edit_collect_completion_from_one_buffer().

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
feca634073 Ticket #4160: mceditor: complete words from all open files.
Initial step: refactoring.

(edit_collect_completions_get_current_word): return GString. Get rid of
allocate and free an empty string, create string if needed instead.
Reduce variable scope.

(edit_collect_completions): related changes.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-02-07 20:33:20 +03:00
Sebastian Gniazdowski
8177cdd0f1 Ticket #4171: fix usermenu and macro system() calls disrupting terminal.
(execute_menu_command): prepare terminal to run system() and restore
after.

(user_menu_cmd): fix comment.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-01-26 13:52:13 +03:00
Andrew Borodin
653961523c Ticket #4182: fix command line update.
(setup_cmdline): don't update command line if it's invisible.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-01-24 14:26:31 +03:00
Andrew Borodin
a88a626e76 Fix segfault on switch to subshell in mcedit/mcview/mcdiffview.
(do_update_prompt): fix NULL dereference. In case of running mc
as standalone editor/viewer/diffviewer, the subshell_prompt variable
is NULL.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-01-18 21:27:26 +03:00
Andrew Borodin
fd65a1654d (edit_store_macro_cmd): restore lost 'else'.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-01-05 08:27:42 +03:00
Andrew Borodin
5a45ed1583 Fix segfault on adding current path to hotlist.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-01-03 08:15:56 +03:00
Andrew Borodin
01ca2756e1 (tree_store_load_from): remove extra parenthesis.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andrew Borodin
1c8400d6ef (tree_store_load_from): fix copy-into-fixed-size-buffer warning.
Found by Coverity.
Coverity id #32616.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andrew Borodin
a17dd53c29 (create_panel): remove extra test of midnight_dlg.
midnight_dlg is never NULL in create_panel().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andreas Mohr
3cd408407d (edit_scroll_screen_over_cursor): fix copy-paste error.
Found by Coverity.
Coverity id #32566.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andreas Mohr
3114240921 (pipe_mail): fix unchecked return value warning.
If function failed, fail early.

Found by Coverity.
Coverity id #32538.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andreas Mohr
dfb81a3dae (edit_read_syntax_file): fix logically dead code.
Statement cannot be true at this state.

Found by Coverity.
Coverity id #32572.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andreas Mohr
68b803e5c4 (edit_suggest_current_word): the NULL check is unnecessary...
...because the pointer can't be NULL.

Found by Coverity.
Coverity id #313667.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andreas Mohr
ae244077af (edit_get_match_keyword_cmd): fix possible NULL dereference.
Found by Coverity.
Coverity id #32609.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andreas Mohr
a68f2d1202 (mcview_growbuf_read_until): the NULL check is unnecessary...
...because the pointer can't be NULL.

Found by Coverity.
Coverity id #110819.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andreas Mohr
f57e69ad29 (cpio_read_bin_head): fix unintended sign extension.
If c_filesizes[0] is greater than 0x7fff implicit sign extension will happen on bit shift.

Found by Coverity.
Coverity id #32611.
Coverity id #32612.

Signed-off-by: Andreas Mohr <and@gmx.li>
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
38fee964bc (copy_file_file): minor refactoring.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andreas Mohr
5f482396f6 (handle_console_linux): fix resource leak.
Handle open failure properly.

Found by Coverity.

Coverity id #32608.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andrew Borodin
35911c08e1 (do_background): fix yet another resource leak.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andreas Mohr
88b6c3e930 (do_background): fix resource leak.
Found by Coverity.

Coverity id #32606.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andreas Mohr
e7a4f0932d (search_content): fix uninitialized scalar variable.
Found by Coverity.

Coverity id #32628.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andreas Mohr
0281ba51b7 (tar_read_header): fix uninitialized scalar variable.
Found by Coverity.

Coverity id #32634.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andreas Mohr
7916e8e097 src/vfs/fish/fish.c: fix uninitialized scalar variable.
Found by Coverity.

Coverity id #32630.
Coverity id #164548.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andreas Mohr
a37a4eba73 src/vfs/extfs/extfs.c: fix uninitialized scalar variable.
Found by Coverity.

Coverity id #32627.
Coverity id #313665.
Covertiy id #313669.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andreas Mohr
57f5ab7c23 Add break before empty default in switch.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andrew Borodin
3d4d6dbb41 (advanced_chown_refresh): constify atgument.
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
Andreas Mohr
a13c0a5e42 (hotlist_run_cmd): fix fallthrough annotation warning.
fallthrough annotation does not directly precede switch label.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andrew Borodin
a358c8037d src/filemanager/mountlist.c: recognize more file system types as remote.
Sync with gnulib dd1fc46be12d671c1a9d9dc5a6fa8c766e99aa2f.

Sync "remote" file systems from stat.c in coreutils.
Note we only consider file systems that do not use host:resource
mount source.  I.e. those that don't generally use a colon when
mounting, as that case is already considered.  Searching for
"<fstype> /etc/fstab" was informative for identifying these.
The full list of "remote" file systems in coreutils is currently:
  acfs afs ceph cifs coda fhgfs fuseblk fusectl
  gfs gfs2 gpfs ibrix k-afs lustre novell nfs nfsd
  ocfs2 panfs prl_fs smb smb2 snfs vboxsf vmhgfs vxfs
Note also we do not include virtual machine file systems,
as even though they're remote to the current kernel,
they are generally not distributed to separate hosts.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andrew Borodin
cc470c615a (tty_clear_screen): rename from clr_scr and move to lib/tty.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andrew Borodin
247ce0928d src/filemanager/find.c: get rid of global variable current_panel usage.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andrew Borodin
adb252c93e (single_dirsize_cmd): don't use global variable current_panel.
(dirsize_cmd): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andrew Borodin
59070e8313 (change_panel): return current_panel.
(chdir_other_panel): use result of change_panel() instead of global
variable current_panel.  (chdir_to_readlink): likewise.
(tree_chdir_sel): likewise.
(quick_view_cmd): mark that we don't use the result of change_panel().
(midnight_execute_cmd): likewise.
(panel_mouse_callback): likewise.
(tree_mouse_callback): likewise.
(mcview_mouse_callback): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andrew Borodin
be14894455 (panel_select_ext_cmd): get rid of global variable current_panel usage.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andrew Borodin
84e1bfcbd7 (panel_sync_other): get rid of global variable current_panel usage.
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
952933d0a7 src/filemanager/file.c: fix comments.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andrew Borodin
33b1a58e24 (delete_cmd): get rid of global variable current_panel usage.
(delete_cmd_local): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andrew Borodin
ab4345510b (copy_cmd): get rid of global variable current_panel usage.
(copy_cmd_local): likewise.
(rename_cmd): likewise.
(rename_cmd_local): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andrew Borodin
11d862c9ec (smart_dirsize_cmd): get rid of global variable current_panel usage.
(single_dirsize_cmd): likewise.
(dirsizes_cmd): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andrew Borodin
482218216f (edit_cmd) : get rid of global variable current_panel usage.
(edit_cmd_force_internal): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andrew Borodin
759b568810 (do_view_cmd): get rid of global variable current_panel usage.
(view_cmd): likewise.
(view_file_cmd): likewise.
(view_raw_cmd): likewise.
(view_filtered_cmd): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andrew Borodin
51d3a39d19 (mkdir_cmd): get rid of global variable current_panel usage.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andrew Borodin
4bae23495a (cd_box): get rid of global variable current_panel usage.
(quick_cd_cmd): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andrew Borodin
7fefe1874a src/filemanager/hotlist.c: get rid of global variable current_panel usage.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andrew Borodin
2e8846163b src/filemanager/chattr.c: get rid of global variable current_panel usage.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andrew Borodin
0c00ead1b0 src/filemanager/chown.c: get rid of global variable current_panel usage.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andrew Borodin
54642d315f src/filemanager/chmod.c: get rid of global variable current_panel usage.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andrew Borodin
e801b62d73 src/filemanager/achown.c: get rid of global variable current_panel usage.
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
1869dffd14 Ticket #4103: code cleanup before 4.8.26 release.
Initial step: rename keymap sections:
  main -> filemanager
  main:xmap -> filemanager:xmap

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andrew Borodin
861f89e4eb Ticket #4155: preserve 0000 permissions on copy/move.
(copy_file_file): remove hack for Windows NT ftp server.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-23 15:33:44 +03:00
Andrij Abyzov
27de03754f Ticket #3987: implement a workaround if readdir() system call returns with EINTR.
On Linux >= 5.1, MC sometimes shows empty directpries on mounted CIFS
shares. Rereading directory restores the directory content.

(local_opendir): reopen directory, if first readdir() returns NULL and
errno == EINTR.

Signed-off-by: Andrij Abyzov <aabyzov@slb.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-13 20:12:14 +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
4a83daacc4 Ticket #4147: VFS timestamps: use g_get_real_time().
In the function vfs_expire(), curr_time and exp_time are declared
guint64. curr_time is initialised with a timestamp and exp_time
with this timestamp minus vfs_timeout seconds. Later there is if
(stamping->time <= exp_time). Prior to commit
a94dd7d2de curr_time was initialised with
a value larger than vfs_timeout seconds, so everything was fine. This
commit changed the initialisation to a timer starting when mc is
started. So for the first vfs_timeout seconds, the result of the
subtraction is negative, but it is a guint64, so we just get a VERY
large unsigned value and the if (stamping->time <= exp_time) is always
true. So mc thinks the vfs hasn't been used recently and goes into an
infinite loop.

If one opens a .rpm file with mc and goes into the CONTENTS.cpio and
then tries to go into the .tar.gz there (this is the usual structure of
a .rpm) after waiting vfs_timeout seconds, everything is fine. However,
before vfs_timeout seconds, mc hangs.

Solution: use g_get_real_time() instead of mc_timer_elapsed().

Thanks nvwarr at hotmail.com for finding out the reason for this bug.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-12 20:39:01 +03:00
Andrew Borodin
9ed9f45eac WTree: get rid of file name limitation in quick search.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-12 20:23:05 +03:00
Andrew Borodin
4eb1fcd6b7 WPanel: get rid of file name limitation in quick search.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-12 20:23:05 +03:00
Andrew Borodin
0acac06158 (string_file_name): get rid of file name length limitation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-12 20:23:05 +03:00
Andrew Borodin
4c7223e9f2 Ticket #4145: file names longer than 255 bytes are not supported.
Avoid limitation of file name length.

(vfs_dirent): redefined to use instead of standard "struct direct"
to hold file name of any length.
(vfs_class::readdir): return newly allocated vfs_dirent structure.
Related changes.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-12 20:23:05 +03:00
Andrew Borodin
5b44805abf Ticket #4133: allow running clipboard commands if DISPLAY is not set.
This can be used for running a clipboard script (from a virtual terminal)
that autodetects (or requests from sytemctl) the proper values of DISPLAY
and XAUTHORITY without the need of exporting these variables to the whole
virtual terminal session.

(clipboard_file_to_ext_clip): don't test DISPLAY environment variable.
(clipboard_file_from_ext_clip): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-11-21 14:51:34 +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
d3c8e5bad7 Ticket #4077: extfs: handle file names started with dash or space.
* (extfs_open_archive): skip leading ./ in file names. extfs plug-ins
  are added leading ./ to handle files with name started with space.
  * (extfs_cmd): skip leading ./ added in name_quote(). ./ is added to
  handle files with name started with dash.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-11-21 14:48:06 +03:00
Ilia Maslakov
954e83191c Ticket #4130: add PAK archive support for extfs.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-11-08 17:36:36 +03:00
Vadim Kalinnikov
942c5549c9 Ticket #4100: extfs vfs: support of WIM archive (image).
wimtools (https://wimlib.net/) are required.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-29 16:58:36 +03:00
Andrew Borodin
5bf714b008 Ticket #4131: use G_UNICODE_SPACING_MARK instead of G_UNICODE_COMBINING_MARK.
G_UNICODE_COMBINING_MARK is deperecated in glib >= 30.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-15 15:16:24 +03:00
Andrew Borodin
22adc618b2 src/subshell/common.c: clarify author list.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-13 16:37:46 +03:00
Andrew Borodin
7a641c0df2 iso9660.in: use grep directly.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-13 16:37:46 +03:00
Andrew Borodin
08e1a6ba9e src/filemanager/chattr.c: support dax attribute.
Sync with e2fsprogs 1dd48bc23c3776df76459aff0c7723fff850ea45.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-13 16:37:46 +03:00
Andrew Borodin
5dce2402b0 src/filemanager/find.c: use g_get_real_time() instead of gettimeofday().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-13 16:34:55 +03:00
Andrew Borodin
63aba8f7e2 (do_view_cmd): rename parameter.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-13 16:34:55 +03:00
Andrew Borodin
69e0283794 (view_file): rename parameter in function declaration.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-13 16:34:55 +03:00
Andrew Borodin
f5e7a9d287 (show_editor_viewer_history): fix call of view_file().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-13 16:34:55 +03:00
Andrew Borodin
94fb03c604 Remove one-line header files.
Move declaration of {advanced_chown,chattr,chmod,chown}_cmd() into cmd.h.
Delete src/filemanager/{achown,chattr,chmod,chown}.h

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-13 16:34:55 +03:00
Andrew Borodin
c5c561274b Remove Cray support.
Sync with gnulib dea936112710e82dd42ffbea510f3bb644acdaaa.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-13 16:34:55 +03:00
Andrew Borodin
375839d657 Optimize comparisions in file sort functions.
Use three-valued comparison macro from gnulib
efa15594e17fc20827dba66414fb391e99905394.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-13 16:34:55 +03:00
Andrew Borodin
377476765a src/filemanager/boxes.c: rename variables.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-13 16:34:55 +03:00
Andrew Borodin
402f5d0791 WPanel: reorder fields.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-13 16:34:55 +03:00
Andrew Borodin
94b7c635a3 WPanel: rename "panel_name" fileld to "name".
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-13 16:34:55 +03:00
Andrew Borodin
8550eee2f6 WPanel: change type of "active" and "dirty" fields to gboolean.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-13 16:34:55 +03:00
Andrew Borodin
da223237c8 WPanel: use structure for quick search fields.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-13 16:34:55 +03:00
Andrew Borodin
968d24a38c WPanel: use structure for directory history fields.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-13 16:34:55 +03:00
Andrew Borodin
2dc692c76b Create command_names using macro.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-13 16:34:47 +03:00
Andrew Borodin
0776f2a49c Fix typos.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-13 16:31:22 +03:00
Oswald Buddenhagen
8857423e4e Ticket #4128: improve handling of compressed content in mc.ext.
call 'file' with -z switch to enable getting the type of compressed files,
and use that capability extensively.

the /logs?/ hacks in ext.d/text.sh need to remain for the time being, as
file -z doesn't handle .lz4 files as encapsulated content.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-12 08:36:09 +03:00
Oswald Buddenhagen
436296f517 Disable subshell cursor position translation for bash v5+.
the changelog clearly states that the position is now returned as a
character offset.

amends ff0fc17a.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-12 08:23:03 +03:00
Oswald Buddenhagen
b680f8198d Optimize bash cursor position translation.
the previous algorithm was O(n^2).

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-12 08:23:03 +03:00
Oswald Buddenhagen
563632819d Make query of subshell command buffer leading-dash-safe.
when the command buffer started with a valid option to the "echo"
command, weird things would happen. use "printf" instead, which doesn't
have this problem. this affected only the bash and zsh code paths.

amends ff0fc17a.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-12 08:23:03 +03:00
Oswald Buddenhagen
77c910a818 Prevent word-splitting of the subshell command buffer.
this avoids inadvertent whitespace normalization (compression and
trimming), which is annoying and additionally invalidates the cursor
position.

for bash and zsh that meant quoting the variable expansion, while for
fish it meant removing the pointless indirection through echo.
for bash we had to introduce an indirection through a function, as there
is apparently no way to get the quoting right inside the binding. zsh
already had such an indirection - maybe for the same reason?

amends ff0fc17a.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-12 08:23:03 +03:00
Oswald Buddenhagen
86397c87c6 Fixup FISH subshell setup.
move binding commands out of the fish_prompt function definition, use
consistent command separators, and remove excess backslashes from the
bindings.

amends ff0fc17a.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-12 08:23:03 +03:00
Oswald Buddenhagen
6b7c4f7c14 Do not avoid big stack allocations.
these are cheap and unproblematic (we aren't in the kernel here).

amends ff0fc17a.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-12 08:23:03 +03:00
Oswald Buddenhagen
0c1cb8f9a8 Ticket #4126: fixups to persistent subshell command line buffer support.
fix some comments

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-12 08:23:03 +03:00
Andrew Borodin
2f611780d3 Ticket #4124: standalone mcedit crashes at startup.
Subshell: don't setup command line promt if MC is run as standalone
editor/viewer/diffviewer.

Fix ff0fc17ae3.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-09 14:54:37 +03:00
Eric Roberts
631483ec52 Ticket #4120: tcsh error: "The Commander can't change to the directory".
How to reproduce:

Use tsch as your shell.
ctrl-o
ctrl-c
ctrl-o

mc gives the error:
The Commander can't change to the directory that the subshell claims you
are in. Perhaps you have deleted your working directory, or given
yourself extra permissions with the "su" command?

This commit is really simple workaround that makes the problem go away.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-04 18:51:31 +03:00
Eric Roberts
ff0fc17ae3 Ticket #4114: implement persistent command line buffer for subshell.
This commi allows the user to start typing a command in the MC's command
line, and then continue typing it in the subshell, or to start typing a
command in the subshell, and then finish typing it in the MC's command
line.

It also fixes #2269 and #2110, bugs in which mc can unexpectedly execute
commands without the user's permission.

The new feature works with bash4, zsh, and fish. The bugfix works on all
shells.

How to test the feature:
  Run mc
  Type any command in the command line, but don't hit enter.
  Press Ctrl-O.
  The command you typed will show up in the subshell.
  Type any command in the subshell, but don't hit enter.
  Press Ctrl-O.
  The command you typed will show up in the command line.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-09-27 19:46:12 +03:00
Andrew Borodin
e1c892a49f Ticket #4107: bind ctrl-i to the ChangePanel action.
After ef5f1fa3eb ctrl-i stopped working
on some terminals including native Linux console.

To fix this, add default binging ctrl-i shortcut to ChangePanel action.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-08-15 11:45:46 +03:00
Andrew Borodin
dd25f91dfd Refactoring of directory size caclulation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-08-05 10:43:29 +03:00
Andrew Borodin
5c89d3c2b7 Ticket #4101: wrong copy ETA displaing if "Follow links" is set.
* (do_compute_dir_size): fix directory size calculation.
  Use mc_lstat() if "Follow links" option is set, mc_stat() otherwise.
  * (single_dirsize_cmd): fix compute_dir_size() call.
  * (dirsize_cmd): likewise.
  * (panel_compute_totals): process symlink to directory as directory if
  follow_symlink is set.
  * (panel_operate_init_totals): process symlink to directory as
  directory if "Follow links" option is set.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-08-05 10:43:29 +03:00
Andrew Borodin
8b4386df83 Ticket #4120: draw shadows for dialog boxes and menus.
Thanks Aleš Janda <ales.janda@kyblsoft.cz> for the original patch.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-08-02 16:13:26 +03:00
Andrew Borodin
8e8b91310a Ticket #4104: chattr: mouse clicks on checkboxes have no effect.
(chattrboxes_mouse_callback): mouse events other than scroll ones are
unhandled.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-07-31 20:52:30 +03:00
Koji Builder
99061cc22d Ticket #4091: RPM VFS improvements.
Support weak dependency tags:

ENHANCES, SUGGESTS, RECOMMENDS, SUPPLEMENTS

See https://rpm.org/user_doc/dependencies.html#weak-dependencies
for detais.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-06-21 20:08:19 +03:00
Andrew Borodin
f5d667197b Ticket #4085: mcedit: regex replace: assertion 'string != NULL' failed.
(edit_replace_cmd): don't delete a NULL string.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:49:05 +03:00
Andrew Borodin
0d585eb08d (file_progress_show_total): use hline_set_textv().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andrew Borodin
d35f0c68dc Refactoring: use label_set_textv() where reasonable.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +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
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
3c38214458 (edit_close_cmd): refactor to reduce number of type castings.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andrew Borodin
d786d88299 Find file refactoring:
* (find_cmd): remove.
  * (find_file): rename to find_cmd() and move declaration to cmd.h.
  * find.h: remove.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andrew Borodin
c9e2a4400e Input complete: refactoring.
* (complete): rename to input_complete() and move declaration to
  input.h.
  * input_complete.h: remove.
  * (input_free_completions): rename to input_complete_free() and move
  definition to input_complete.c.
  * lib/widget/input_complete.c: rename variables and function from
  query_* to complete_*.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andrew Borodin
d12caa65d0 (dview_handle_key): refactoring.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andrew Borodin
d68c5c7e13 (help_handle_key): refactoring.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andrew Borodin
ec0c7cd848 (tree_key): fix key handling.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andreas Mohr
fbabe632a0 (user_group_button_cb): fix variable initialization.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andrew Borodin
b0abfc8700 chmod: constify function arguments.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andrew Borodin
4314c04ede chmod: show mark of selected mode bits after dialog recreate.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andrew Borodin
ab73f041a1 chmod_init: clear check_perm[].selected before use.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andrew Borodin
baaef44dde src/filemanager/chmod.c: rename functions:
chmod_init -> chmod_dlg_create
chmod_i18n -> chmod_init

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andrew Borodin
a00b7a672b src/filemanager/chown.c: rename functions:
chown_init -> chown_dlg_create
chown_i18n -> chown_init

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andrew Borodin
ff1a52c229 src/filemanager/achown.c: rename functions:
advanced_chown_init -> advanced_chown_dlg_create
advanced_chown_i18n -> advanced_chown_init

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:18 +03:00
Andrew Borodin
8e51f583dc man2hlp: limited support of \fR, \fB, \fI, and \fP troff commands. 2020-05-17 18:48:18 +03:00
Andrew Borodin
cf1d4d80be src/editor/editcmd.c: minor refactoring and fix coding style.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:18 +03:00
Andrew Borodin
7652b0f3cb (edit_draw_this_line): rename variable because it shadows previous one.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:18 +03:00
Andrew Borodin
2ba413333b src/setup.c: use macros in keymap load/set/free functions.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:18 +03:00
Andrew Borodin
946e8d4888 Ticket #212: implement keybindings for radiobuttons.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:18 +03:00
Andrew Borodin
6fbf3d2ecd (toggle_subshell): clarify message.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:18 +03:00
Andrew Borodin
9581c263b2 VFS: use mc_timer for timestamps.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:18 +03:00
Andrew Borodin
7a58b5e498 Ticket #4050: code cleanup before 4.8.25 release.
mcedit: unify messages.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:18 +03:00
Andrew Borodin
b36b9459d5 Ticket #4081: speed of file copy is not dispalyed for single file.
(panel_operate_init_totals): set ctx->progress_totals_computed to TRUE
in case of copy/move operation for single file.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:42:13 +03:00
Elijah Zarezky
17a5ac322d src/filemanager/chattr.c: add missing comma.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-11 10:31:25 +03:00
Andrew Borodin
e14d44c839 Ticket #3847: chattr command implementattion.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-05 19:06:18 +03:00
Andrew Borodin
bcdd81c628 WGroup: support colors.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-03-08 20:17:32 +03:00
Andrew Borodin
2e734e5618 Make keybind map a member of Widget.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-03-08 20:17:32 +03:00
Andrew Borodin
c2aadb2ad5 WGroup: support mouse events.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-03-08 20:17:32 +03:00
Andrew Borodin
4b3b49faad (widget_draw): support groups.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-03-08 20:17:32 +03:00
Andrew Borodin
540c3813ab Show console content only in midnight_callback (MSG_DRAW).
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-03-08 20:17:32 +03:00
Andrew Borodin
d1f9e698ac WDialog: use WBackground in frameless dialogs (screens).
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-03-08 20:17:32 +03:00
Andrew Borodin
ed9199e94e Create WFrame widget.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-03-08 20:17:02 +03:00
Andrew Borodin
04f04ba130 Send new widget size as parameter of MSG_RESIZE message.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-03-08 20:15:37 +03:00
Andrew Borodin
7329f53da5 WEdit: use WRect to save previous location.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-03-08 20:15:37 +03:00
Andrew Borodin
045816ed13 (dlg_set_position): use WRect.
(widget_set_size_rect): new API.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-03-08 20:15:37 +03:00
Andrew Borodin
6acd8475dd Update cursor API: support groups.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-03-08 20:13:35 +03:00
Andrew Borodin
95b4a86d44 (dlg_get_current_widget_id): rename to group_get_current_widget_id.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-03-08 20:13:35 +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
b9cf650605 Move send broadcast message API from WDialog to WGroup.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-03-08 20:11:55 +03:00
Andrew Borodin
74c510f4fb Widget and WGroup API changes:
* (widget_destroy): new API to destroy widget.
  * (group_del_widget): rename to group_remove_widget. Don't destroy
  widget after remove it from group.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-03-08 20:11:55 +03:00
Andrew Borodin
22ad70ed02 Move widget add/del API from WDialog to WGroup.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-03-08 20:11:55 +03:00
Andrew Borodin
6eedbce076 Move widget selection API from WDialog to WGroup.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-03-08 20:11:39 +03:00
Andrew Borodin
e4e0070db5 Ticket #2919: implement WGroup widget.
WGroup is the base widget for complex objects such as windows, dialog
windows, etc.

Initial steps:
  * move widget list of dialog into WGroup class;
  * inherit WGroup from Widget;
  * inherit WDialog from WGroup.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-03-08 20:09:12 +03:00
Andrew Borodin
1ec7a2b768 src/editor/editdraw.c: refactoring.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-02-29 19:10:18 +03:00
Andrew Borodin
95ed249f6c src/editor/editdraw.c: fix coding style.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-02-29 19:10:18 +03:00
Andrew Borodin
f30b0d35d5 Skins: unify panel-related item names.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-02-29 19:10:17 +03:00
Andrew Borodin
dcd3a7e39e Skins: move items from [widget-common] section to [widget-panel] one.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-02-29 19:10:17 +03:00
Andrew Borodin
9d89f2f20d src/filemanager/dir.c: fix coding style.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-02-29 19:10:17 +03:00
Andrew Borodin
bb93a78336 Sync with gnulib 4d4a22ab1f719b7c6c3fe3dbf45d11baafd3c563.
src/filmanager/mountlist.c: consider smb3 file systems as remote.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-02-29 19:10:17 +03:00
Andrew Borodin
fc818e43ab Sync with gnulib 7a15069b68a376f26c5dca34ae2689c5bf8adc99.
src/filemanager/mountlist.c: consider AFS filesystems as remote.

Treat mounts of type 'afs' (OpenAFS, kernel kafs) and 'auristorfs'
(AuriStorFS) as remote.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-02-29 19:10:17 +03:00
Andrew Borodin
4423421014 Ticket #4068: fix preprocessor tests.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-02-29 19:10:17 +03:00
Andrew Borodin
f25135b74b src/textconf.c: use puts() to print simple strings.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-02-29 19:10:17 +03:00
Andrew Borodin
81fc8e7016 (show_version): show library versions.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-02-29 19:10:17 +03:00
Andrew Borodin
acdf388291 src/filemanager/panel.c: fix coding style.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-02-29 19:10:17 +03:00
Andrew Borodin
ab248ecaad Visualize changes in "Layout" dialog box immediately.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-02-29 19:10:17 +03:00
Andrew Borodin
03c54082a6 src/filemanager/layout.c: rename variable.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-02-29 19:10:17 +03:00
Andrew Borodin
bedc7e5c12 src/filemanager/layout.c: fix variable type.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-02-29 19:10:17 +03:00
Andrew Borodin
03af8ba4c1 (load_setup_get_keymap_profile_config): use MC_PTR_FREE macro.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-02-29 19:10:17 +03:00
Andrew Borodin
299b94884e (free_keymap_defs): fix memory leak: free menu keymap.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-02-29 19:10:17 +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
c867b9d40e Ticket #5056: avoid subshell warning for mcedit run from mc.
Don't show message "GNU Midnight Commander is already running on this
terminal. Subshell support will be disabled." if standalone
mcedit/mcview/mcdiffview is run from mc. Show this message only in case
of mc run from another mc, as was before commit
41abcbf706 (ticket #3380).

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-02-08 19:26:49 +03:00
Andrew Borodin
21d993facd Ticket #3722: file manager: clarify double click behaviour.
Don't execute (or enter to) last file on double click on empty area.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-02-02 19:17:49 +03:00