Commit Graph

5276 Commits

Author SHA1 Message Date
Andrew Borodin
1c26cf804a src/filemanager/usermenu.c: apply coding guidelines.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-03-04 09:23:36 +03:00
Andrew Borodin
0e1dfbf2b9 (regex_command_for): minor optimisation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-03-04 09:23:36 +03:00
Yury V. Zaytsev
391821e4ab Ticket #3379: fix bashism in gitfs+ extfs helper
Original reporter: Raphael Geissert <atomo64@gmail.com>, upstreamed by
Dmitry Smirnov <onlyjob@member.fsf.org>.

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-03-04 09:23:36 +03:00
Andrey Gursky
47830e09b4 src/filemanager/file.c: (copy_file_file) fix typo in the error message
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-02-29 22:17:35 +01:00
Andrey Gursky
5f63997891 Type accuracy in file operation routines (leftovers)
These are leftovers of 159f5fdff1.

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-02-29 22:16:29 +01:00
Andrey Gursky
9ee5766748 Ticket #3577: Fix preallocation if appending during file copy
The value of `ctx->do_append` is reset:

    appending = ctx->do_append;
    ctx->do_append = FALSE;

Use `appending` in following conditionals instead.

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-02-29 22:12:28 +01:00
Andreas Mohr
ee6dd89deb Ticket #3599: provide major/minor info for block/char devices (FISH)
Perl ls helper did not provide major/minor info for block/char devices,
and `ls -lan` wasn't working because of a typo.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-02-28 22:03:37 +01:00
Andrew Borodin
2f53c46279 Find File: reorder content related checkboxes.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-02-27 09:11:40 +03:00
Andrew Borodin
9fba781d45 Remove "Search for content" checkbox.
If "Content" input field is empty, don't search for content.
Also disable all content related checkboxes in this case.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-02-27 09:11:40 +03:00
Andrew Borodin
2b6c45a211 Ticket #3594: Find file: change behavior of content search.
Initial commit: refactoring.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-02-27 09:11:40 +03:00
Mooffie
ebf57a81fb Expand comment about hypothetical MSG_ACTIVATE.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-02-23 20:49:13 +03:00
Andrew Borodin
3e8d61bbd5 Disable some filename related checkboxes if filename is empty.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-02-21 10:47:59 +03:00
Andrew Borodin
ebd6c95e83 Ticket #3593: Find file: empty file name matches any file name.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-02-21 10:39:22 +03:00
Andreas Mohr
924a84a3b4 sftpfs: fix bad pointer arithmetic in config parser.
When reading ssh_config with matching host entry mc do bad pointer arithmetic.
Fix it! (Also move offsetof values into struct to reduce human mistakes.)

==18689==ERROR: AddressSanitizer: heap-use-after-free on address 0x604000004910 at pc 0x000000641a8b bp 0x7ffca4ab65e0 sp 0x7ffca4ab65d8
WRITE of size 8 at 0x604000004910 thread T0
    #0 0x641a8a in sftpfs_fill_config_entity_from_string /tmp/portage/app-misc/mc-9999/work/mc-9999/src/vfs/sftpfs/config_parser.c:169:30
    #1 0x6413cf in sftpfs_fill_config_entity_from_config /tmp/portage/app-misc/mc-9999/work/mc-9999/src/vfs/sftpfs/config_parser.c:271:13
    #2 0x640b73 in sftpfs_get_config_entity /tmp/portage/app-misc/mc-9999/work/mc-9999/src/vfs/sftpfs/config_parser.c:310:14
    #3 0x64067d in sftpfs_fill_connection_data_from_config /tmp/portage/app-misc/mc-9999/work/mc-9999/src/vfs/sftpfs/config_parser.c:354:21
    #4 0x61ef95 in sftpfs_cb_open_connection /tmp/portage/app-misc/mc-9999/work/mc-9999/src/vfs/sftpfs/vfs_subclass.c:111:5
    #5 0x7f1340c31beb in vfs_s_get_path /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/vfs/direntry.c:1139:18
    #6 0x7f1340c3685c in vfs_s_inode_from_path /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/vfs/direntry.c:380:9
    #7 0x7f1340c34807 in vfs_s_opendir /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/vfs/direntry.c:409:11
    #8 0x7f1340c34ce8 in vfs_s_chdir /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/vfs/direntry.c:476:12
    #9 0x7f1340c3a29f in mc_chdir /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/vfs/interface.c:687:14
    #10 0x530f64 in _do_panel_cd /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/panel.c:3250:9
    #11 0x530e4e in do_panel_cd /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/panel.c:4627:9
    #12 0x532d34 in do_cd /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/panel.c:5027:11
    #13 0x50b64b in do_cd_command /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/command.c:445:14
    #14 0x50c516 in enter /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/command.c:265:9
    #15 0x52704c in midnight_callback /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/midnight.c:1473:17
    #16 0x7f1340c4c761 in dlg_key_event /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/dialog.c:505:15
    #17 0x7f1340c4cc32 in frontend_dlg_run /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/dialog.c:570:9
    #18 0x7f1340c4c935 in dlg_run /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/dialog.c:1267:5
    #19 0x52654d in do_nc /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/midnight.c:1757:9
    #20 0x4f7d8a in main /tmp/portage/app-misc/mc-9999/work/mc-9999/src/main.c:401:21
    #21 0x7f133f1b8953 in __libc_start_main (/lib64/libc.so.6+0x20953)
    #22 0x427368 in _start (/tmp/portage/app-misc/mc-9999/work/mc-9999/src/.libs/mc+0x427368)

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-02-13 16:38:40 +03:00
Andrew Borodin
0fb104d2b3 (sftpfs_fill_config_entity_from_config): fix read of config file.
Also fix memory leak.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-02-13 16:37:49 +03:00
Andrew Borodin
8b5f62d244 Use LIBSSH2_INVALID_SOCKET macro.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-02-13 16:37:49 +03:00
Andrew Borodin
b3f5a0ae5e libssh2_session_startup() is deprecated in libssh2 >= 1.2.8.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-02-13 16:35:13 +03:00
Andreas Mohr
e740c7d3e5 SFTP: refactoring.
Re-order open_connection and reverse re-order close_connection steps.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-02-13 16:35:13 +03:00
Andreas Mohr
ece1d020fa SFTP: minor refactoring.
sftpfs_super_data created at sftpfs_cb_open_connection() was freed at sftpfs_close_connection().
It should be sftpfs_cb_close_connection() for logical right location.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-02-13 16:35:13 +03:00
Andreas Mohr
298273b8f5 (sftpfs_close_connection): fix connection memleaks.
mc missing to free up sftp session data.
This disclose that mc misleadingly freed an internal libssh2.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-02-13 16:35:13 +03:00
Andreas Mohr
49b59018c9 (sftpfs_close_connection): fix connection memleaks.
When sftpfs_open_connection failed free elements at sftpfs_close_connection().
This was not happen when mcerror was set.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-02-13 16:35:13 +03:00
Andrew Borodin
0376fb50e0 Ticket #3581: various SFTP fixes.
(sftpfs_cb_open_connection): initialise sftpfs_super_data_t::socket_handle correctrly.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-02-13 16:35:13 +03:00
Andrew Borodin
6fac768fbf Clarify some error messages using error code.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-02-02 09:42:51 +03:00
Andreas Mohr
b9797d6637 Use meaningful errno or 0.
Use real errno or set it to 0 when no meaningful error code exists
for current user error message.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-02-02 09:42:51 +03:00
Andrew Borodin
8fc0e1d76d Ticket #2673: support LZIP compression.
Thanks Matias A. Fonzo <selk at dragora.org> for the original patch.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-28 16:45:36 +03:00
Mooffie
2347ac38b6 Ticket #2588: cannot set mini-format for "brief" listing type.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-28 16:28:30 +03:00
Andreas Mohr
30b6888fcc Ticket #3582: fix infopanel overflow
Testcase: hit C-x i on a file and delete this file

==13429==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x607000031c48 at pc 0x0000005fd41b bp 0x7ffca3f466c0 sp 0x7ffca3f466b8
WRITE of size 4 at 0x607000031c48 thread T0
    #0 0x5fd41a in dirsize_status_deinit_cb /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/file.c:2557:24
    #1 0x7f333f2bda2f in status_msg_deinit /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/wtools.c:619:9
    #2 0x602fe3 in panel_operate_init_totals /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/file.c:1352:9
    #3 0x5fe784 in panel_operate /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/file.c:2840:13
    #4 0x528328 in copy_cmd /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/cmd.c:797:9
    #5 0x528328 in midnight_execute_cmd /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/midnight.c:1139
    #6 0x7f333f291949 in buttonbar_callback /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/buttonbar.c:172:42
    #7 0x7f333f296245 in send_message /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/../../lib/widget/widget-common.h:167:15
    #8 0x7f333f296245 in dlg_try_hotkey /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/dialog.c:464
    #9 0x7f333f296245 in dlg_key_event /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/dialog.c:509
    #10 0x7f333f296245 in dlg_process_event /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/dialog.c:1236
    #11 0x7f333f2979c7 in frontend_dlg_run /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/dialog.c:570:9
    #12 0x7f333f296565 in dlg_run /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/dialog.c:1267:5
    #13 0x4fc7b8 in create_panels_and_run_mc /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/midnight.c:954:5
    #14 0x4fc7b8 in do_nc /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/midnight.c:1757
    #15 0x4fc7b8 in main /tmp/portage/app-misc/mc-9999/work/mc-9999/src/main.c:401
    #16 0x7f333d7fc953 in __libc_start_main (/lib64/libc.so.6+0x20953)
    #17 0x4270e8 in _start (/tmp/portage/app-misc/mc-9999/work/mc-9999/src/.libs/mc+0x4270e8)

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-17 12:22:57 +03:00
Andreas Mohr
2e04dfd8f6 Ticket #3433: extfs/uzip: adjust abnormal directory permission.
unzip 6.0 source reveal that unzip depends on filename and less on given zip object attribute.

zipinfo can show something like
    Unix file attributes (177777 octal):            ?rwsrwsrwt
but unzip handle this object as directory if filename ended on '/'.

In this case adjust permission string for reasonable extfs handling
for all other cases uzip remain conservative and relay on proper permission.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-17 10:49:50 +03:00
Andreas Mohr
c1ea489753 Ticket #3412: info panel: rely on realpath for device info.
When cd_symlinks is enabled cwd_vpath isn't pointed to real path.
Hence device info may wrong.

(Support for local filesystems only.)

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-17 10:28:33 +03:00
Andreas Mohr
bcbea25234 Ticket #3214: avoid invalid free nodes display.
nfree and nodes can be -1. Don't print such numbers at info panel.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-17 10:18:01 +03:00
Andrew Borodin
e7bdd9c5b2 Ticket #3578: (regex_command_for) match filename, not full path in mc.ext
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-01-10 16:59:46 +01:00
Mooffie
755a2b820e Ticket #3565: "External Panelize": use WListbox's notification. notification.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-08 12:32:13 +03:00
Mooffie
e7fdb55005 Ticket #3563: "Directory hotlist": use WListbox's change notification.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-08 12:00:13 +03:00
Andrew Borodin
bc200742d1 Indentation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-03 15:36:09 +03:00
Andrew Borodin
6dcba5568f Ticket #3527: uc1541 extfs: update version.
The current version is 2.8: besides of some tweaks and fixes,
support for compressed disk images was introduced.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-03 10:47:23 +03:00
Andrew Borodin
123ab6e1bf (edit_get_bracket): minor optimisation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-03 10:26:47 +03:00
Andreas Mohr
6dad88df1c Ticket #3579: (edit_get_bracket): fix buffer overflow.
Testcase:
create file with byte 0x28 and byte 0x00 -> open in mcedit -> move cursors

Found by Clang/AddressSanitizer

==3716==ERROR: AddressSanitizer: global-buffer-overflow on address 0x00000068886a at pc 0x000000598c09 bp 0x7ffeed4b0350 sp 0x7ffeed4b0348
READ of size 1 at 0x00000068886a thread T0
    #0 0x598c08 in edit_get_bracket /tmp/portage/app-misc/mc-9999/work/mc-9999/src/editor/edit.c:1525:9
    #1 0x58ea18 in edit_find_bracket /tmp/portage/app-misc/mc-9999/work/mc-9999/src/editor/edit.c:3173:32
    #2 0x596ed4 in edit_execute_cmd /tmp/portage/app-misc/mc-9999/work/mc-9999/src/editor/edit.c:3960:5
    #3 0x58ed08 in edit_execute_key_command /tmp/portage/app-misc/mc-9999/work/mc-9999/src/editor/edit.c:3224:5
    #4 0x5c4dcd in edit_callback /tmp/portage/app-misc/mc-9999/work/mc-9999/src/editor/editwidget.c:1136:17
    #5 0x7f80f324ca11 in send_message /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/../../lib/widget/widget-common.h:167:15
    #6 0x7f80f324ca11 in dlg_key_event /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/dialog.c:515
    #7 0x7f80f324ca11 in dlg_process_event /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/dialog.c:1236
    #8 0x7f80f324e0b7 in frontend_dlg_run /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/dialog.c:570:9
    #9 0x7f80f324cc35 in dlg_run /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/dialog.c:1267:5
    #10 0x5c1719 in edit_files /tmp/portage/app-misc/mc-9999/work/mc-9999/src/editor/editwidget.c:1255:9
    #11 0x5c0426 in edit_file /tmp/portage/app-misc/mc-9999/work/mc-9999/src/editor/editwidget.c:1194:10
    #12 0x5f048b in edit_file_at_line /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/cmd.c:704:9
    #13 0x52bf9c in do_edit /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/cmd.c:168:5
    #14 0x52bf9c in edit_cmd /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/cmd.c:742
    #15 0x52bf9c in midnight_execute_cmd /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/midnight.c:1175
    #16 0x7f80f3248019 in buttonbar_callback /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/buttonbar.c:172:42
    #17 0x7f80f324c915 in send_message /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/../../lib/widget/widget-common.h:167:15
    #18 0x7f80f324c915 in dlg_try_hotkey /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/dialog.c:464
    #19 0x7f80f324c915 in dlg_key_event /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/dialog.c:509
    #20 0x7f80f324c915 in dlg_process_event /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/dialog.c:1236
    #21 0x7f80f324e0b7 in frontend_dlg_run /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/dialog.c:570:9
    #22 0x7f80f324cc35 in dlg_run /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/dialog.c:1267:5
    #23 0x4fc967 in create_panels_and_run_mc /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/midnight.c:954:5
    #24 0x4fc967 in do_nc /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/midnight.c:1757
    #25 0x4fc967 in main /tmp/portage/app-misc/mc-9999/work/mc-9999/src/main.c:463
    #26 0x7f80f17c2953 in __libc_start_main (/lib64/libc.so.6+0x20953)
    #27 0x427008 in _start (/usr/bin/mc+0x427008)

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-03 10:22:44 +03:00
Andreas Mohr
b5ccd12d32 Ticket #3523: support lz4 compress format.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-02 14:02:08 +03:00
Andrew Borodin
471ea781ca Update copyright years.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:10 +03:00
Andreas Mohr
697e406eb8 Robust sizeof() usage at function parameter and use memcpy destination sizeof...
...for more resilient to errors.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:09 +03:00
Andreas Mohr
0e05710715 Remove unused function exec_shell().
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:09 +03:00
Andreas Mohr
c314995b9f viewer: remove unused const value.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:09 +03:00
Andreas Mohr
5d8a9cdfbb diffviewer: use gboolean at WDiff struct.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:09 +03:00
Andreas Mohr
efb7ee97e4 Clarify function declare at USE_DIFF_VIEW.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:09 +03:00
Andrew Borodin
00c6502ad9 (tree_store_load_from): optimise and fix return value.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:09 +03:00
Andrew Borodin
69f4d8c986 (tree_store_save): optimisation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:08 +03:00
Andreas Mohr
28280c1870 cleanup gcc link time optimization warnings
coord_cache.c: In function 'mcview_ccache_lookup.constprop':
coord_cache.c:374:31: error: 'nextc' may be used uninitialized in this function [-Werror=maybe-uninitialized]
coord_cache.c:342:16: note: 'nextc' was declared here
boxes.c: In function 'sort_box':
boxes.c:877:5: error: 'sort_names_num' may be used uninitialized in this function [-Werror=maybe-uninitialized]
boxes.c:871:11: note: 'sort_names_num' was declared here
actions_cmd.c: In function 'mcview_callback':
actions_cmd.c:252:42: error: 'byte_val' may be used uninitialized in this function [-Werror=maybe-uninitialized]
actions_cmd.c:223:9: note: 'byte_val' was declared here

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:08 +03:00
Andrew Borodin
f252234772 (tree_entry, TreeStore): use gboolean instead of bit fields.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:08 +03:00
Andreas Mohr
212ed8f5a0 (edit_sort_cmd): fix memory leak.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:08 +03:00
Andreas Mohr
31e4b2b57a Ticket #3572: (edit_set_spell_lang): fix memory leak.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:08 +03:00
Andrew Borodin
2b1fa34c9a (configure_panel_listing): fix memory leak.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:08 +03:00
Andrew Borodin
c5714eee34 Use STR_E_NOTFOUND message where required.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:08 +03:00
Andrew Borodin
e85b3f192e (extfs_find_entry_int): fix comparisons.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:08 +03:00
Andrew Borodin
a6f5767f3f Use signed long instead of unsigned long for binded actions.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:08 +03:00
Andreas Mohr
957185a47b (remove_entry): fix memleak.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:08 +03:00
Andrew Borodin
66a6185064 (tree_store_mark_checked): get rid of extra memory duplication.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:07 +03:00
Andreas Mohr
d126c5e664 Ticket #3561: (tree_store_mark_checked): fix meleak.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:07 +03:00
Andreas Mohr
5a180335cf src/filemanager/chmod.c: fix -Wsign-conversion warnings:
chmod.c:245:41: warning: implicit conversion changes signedness: 'unsigned int' to 'int' [-Wsign-conversion]
chmod.c:266:41: warning: implicit conversion changes signedness: 'unsigned int' to 'int' [-Wsign-conversion]
chmod.c:321:49: warning: implicit conversion changes signedness: 'unsigned int' to 'int' [-Wsign-conversion]
chmod.c:352:72: warning: implicit conversion changes signedness: 'int' to 'button_flags_t' [-Wsign-conversion]
chmod.c:357:72: warning: implicit conversion changes signedness: 'int' to 'button_flags_t' [-Wsign-conversion]
chmod.c:367:42: warning: implicit conversion changes signedness: 'int' to 'button_flags_t' [-Wsign-conversion]
chmod.c:371:42: warning: implicit conversion changes signedness: 'int' to 'button_flags_t' [-Wsign-conversion]

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:07 +03:00
Andreas Mohr
e84513a745 src/filemanager/chown.c: fix -Wsign-conversion warnings:
chown.c:136:34: warning: implicit conversion changes signedness: 'int' to 'unsigned int' [-Wsign-conversion]
chown.c:254:14: warning: implicit conversion changes signedness: 'int' to 'unsigned int' [-Wsign-conversion]
chown.c:259:78: warning: implicit conversion changes signedness: 'int' to 'button_flags_t' [-Wsign-conversion]
chown.c:270:42: warning: implicit conversion changes signedness: 'int' to 'button_flags_t' [-Wsign-conversion]
chown.c:274:42: warning: implicit conversion changes signedness: 'int' to 'button_flags_t' [-Wsign-conversion]

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:07 +03:00
Andreas Mohr
427dc18314 src/filemanager/achown.c: fix -Wsign-conversion and -Wshorten-64-to-32 warnings:
achown.c:480:10: warning: implicit conversion loses integer precision: 'unsigned long' to 'unsigned int' [-Wshorten-64-to-32]
achown.c:687:28: warning: implicit conversion changes signedness: 'int' to 'button_flags_t' [-Wsign-conversion]
achown.c:689:28: warning: implicit conversion changes signedness: 'int' to 'button_flags_t' [-Wsign-conversion]
achown.c:691:28: warning: implicit conversion changes signedness: 'int' to 'button_flags_t' [-Wsign-conversion]
achown.c:693:26: warning: implicit conversion changes signedness: 'int' to 'button_flags_t' [-Wsign-conversion]
achown.c:695:27: warning: implicit conversion changes signedness: 'int' to 'button_flags_t' [-Wsign-conversion]
achown.c:712:82: warning: implicit conversion changes signedness: 'int' to 'button_flags_t' [-Wsign-conversion]
achown.c:718:82: warning: implicit conversion changes signedness: 'int' to 'button_flags_t' [-Wsign-conversion]
achown.c:730:78: warning: implicit conversion changes signedness: 'int' to 'button_flags_t' [-Wsign-conversion]
achown.c:736:78: warning: implicit conversion changes signedness: 'int' to 'button_flags_t' [-Wsign-conversion]

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:07 +03:00
Andreas Mohr
3a714da154 Fix -Wconversion warning for mask/mode values: use mode_t instead of int.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:07 +03:00
Andrew Borodin
ee6f45577a (edit_drop_menu_cmd): fix -Wsign-conversion warning.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:07 +03:00
Andreas Mohr
5007d309bc Fix -Wconversion warning for mc_search_new().
mc_search_new() parameter orignial_len use once only.
Factor out into own function mc_search_new_len().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:07 +03:00
Mooffie
2627da4b73 panel.h: remove unused variable declaration.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:06 +03:00
Mooffie
162f8a9fa7 Ticket #3555: panel.h: define typedef list_type_t.
We use 'typedef' to make it conform with all other type declarations
in that file.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:06 +03:00
Slava Zanko
84c81f1f92 Remove duplicate code from src/subshell/common.c.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2016-01-01 11:48:06 +03:00
Slava Zanko
7f383fbd6b Add mc_shell_init() and mc_shell_deinit() functions.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2016-01-01 11:48:06 +03:00
Slava Zanko
0e79be1b7a Introduce mc_shell_t type.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2016-01-01 11:48:06 +03:00
Andrew Borodin
e2391af431 (init_subshell_child): use exist_file().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:06 +03:00
Andrew Borodin
d23c80c422 src/subshell/common.c: respect coding guidelines.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:06 +03:00
Slava Zanko
974ab368ec Ticket #3547: code cleanup before 4.8.16 release.
Move subshell stuff into subdir.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2016-01-01 11:48:06 +03:00
Denys Vlasenko
545e341c68 isofs: fix incorrect awk comparison operator
SEMICOLON = "YES" is not a correct comparison op (should use ==),
it's assignment! As a result, sub(";1$", "", name) was always executed.

Untested - I have no idea when SEMICOLON is not "YES"

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-12-31 11:05:46 +03:00
Denys Vlasenko
6d48c59efb Ticket #3537: isofs fix: do not skip all .dotfiles
There is a simple bug in iso9660 helper:

    if (name ~ /^\.\.?/) next

means "skip all lines which start with one or two dots".
Author probably meant:

    if (name ~ /^\.\.?$/) next

I propose to not be cryptic and just check both possibilities separately.

The below trivial patch was tested to work: now I see
the file named ".dot" in a test iso file.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2015-12-31 11:05:46 +03:00
Andrew Borodin
8b6c172880 (mcview_do_search): clarify seach start and end positions. 2015-12-31 10:48:57 +03:00
Andrew Borodin
5d76c8e2c2 (mcview_do_search): cleanup variables. 2015-12-31 10:48:57 +03:00
Andrew Borodin
d3a2ca3e12 Ticket #3543: mcview: "Not found" result isn't reported in some cases.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-12-31 10:48:57 +03:00
Slava Zanko
0d6d1d0d5c revert changes related to BASH shell prompt
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2015-11-10 13:29:46 +03:00
Slava Zanko
bf1ff69fb8 Code refactoring
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2015-11-10 13:29:45 +03:00
Alexander Kriegisch
f596c916a4 New subshell types Busybox ash + Debian ash (dash) and some more enhancements plus fish chdir bugfix
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2015-11-10 11:55:35 +03:00
Alexander Kriegisch
039fd561d2 Make MC's special commands not show up in bash's history and also suppress consecutive identical commands.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2015-11-10 11:33:03 +03:00
Alexander Kriegisch
239f695d83 Ticket #2742: [Subshell] Support for ash + bugfixes for bash, fish
Fix non-functional INPUTRC for bash (variable was unset and never used)

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2015-11-10 11:33:03 +03:00
Egmont Koblinger
aa3ec5b260 Ticket #3534: Fix Bash's PROMPT_COMMAND variable.
Another solution.

Signed-off-by: Slava Zanko <v.zanko@godeltech.com>
2015-11-06 12:12:05 +03:00
Slava Zanko
2ac925050d Indentation fix
Signed-off-by: Slava Zanko <v.zanko@godeltech.com>
2015-11-06 11:16:06 +03:00
Egmont Koblinger
5d1944ee82 Ticket #3534: Fix Bash's PROMPT_COMMAND variable.
Signed-off-by: Slava Zanko <v.zanko@godeltech.com>
2015-11-05 16:17:20 +03:00
Andrew Borodin
97f65abd94 Reimplement handling of ev_vfs_print_message_t message.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-11-05 14:33:21 +03:00
Andrew Borodin
70fa973f47 Fix typos.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-11-05 14:33:21 +03:00
Andreas Mohr
b457921fda Ticket #3539: fix reported -Wshadow warning with gcc 4.6.x
src/filemanager/dir.c: In function 'dir_list_grow':
src/filemanager/dir.c:263:14: warning: declaration of 'clear' shadows a global declaration [-Wshadow]

src/viewer/datasource.c: In function 'mcview_load_command_output':
src/viewer/datasource.c:398:16: warning: declaration of 'pipe' shadows a global declaration [-Wshadow]

(This not occur with gcc 4.7 or higher).

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-11-05 14:33:21 +03:00
Andrew Borodin
3e622b822e (vfs_get_current_dir): avoid string duplication.
(vfs_get_current_dir_n): new function returned newly allocated string.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-11-05 14:33:21 +03:00
Andrew Borodin
e4c1ae80eb mountlist: refactoring: reimplement mount list using GSList.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-11-05 14:33:21 +03:00
Andrew Borodin
88612bc618 Sync with gnulub c6148bca89e9465fd6ba3a10d273ec4cb58c2dbe.
mountlist: add me_mntroot field on Linux machines.

Populate me_mntroot in mount_entry so Linux machines based on
/proc/self/mountinfo can distinguish between bind mounts and original
mounts. In reality bind mounts aren't treated differently than
mountroot=/ mounts by the kernel, but the user often wants these bind
mounts distinguished.

Currently, this in not used in mc, but probably can be used in future.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-11-05 14:33:20 +03:00
Andrew Borodin
fdc094324d mcview: zero extension of char to int.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-11-05 14:33:20 +03:00
Andreas Mohr
75039d9d4f Ticket #3522: (edit_suggest_current_word): fix memory leak.
Free each element of spell suggest array.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-11-05 14:33:20 +03:00
Andrew Borodin
acd9433148 Ticket #3521: (edit_load_macro_cmd): fix memory leak.
Create mc_config object only when macro list is empty.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-11-05 14:33:20 +03:00
Andreas Mohr
9d59f7f5f6 Ticket #3520: free editor macros when closing mc.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-11-05 14:33:20 +03:00
Andrew Borodin
d9ad3d2e32 Clarify __attribute ((format (printf))) usage.
Thanks Andreas Mohr <and@gmx.li> for the original patch.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-11-05 14:33:20 +03:00
Andrew Borodin
bb6f1e6695 Fix calls of vfs_print_message(). 2015-11-05 14:32:54 +03:00
Andrew Borodin
83b1d15c9a Fix calls of fish_command(). 2015-11-05 14:32:54 +03:00
Andrew Borodin
bff225c5ff Rename mcview_t back to WView to be consistent with other widget names. 2015-11-05 14:32:53 +03:00
Andrew Borodin
db0412598e src/editor/editbuffer.c: fix typo. 2015-11-05 14:32:53 +03:00
Slava Zanko
d22018d562 Add default cases for switch(){} construction in smbfs
Signed-off-by: Slava Zanko <v.zanko@godeltech.com>
2015-11-05 14:32:53 +03:00