Commit Graph

13377 Commits

Author SHA1 Message Date
Denis Briand
2a4614c535 doc/man/mc.1.in: spelling error - s/interpeted/interpreted/
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-03-25 18:14:51 +01:00
Andrew Borodin
d6f031738c Merge branch '3605_extfs_buffer_overflow'
* 3605_extfs_buffer_overflow:
  Ticket #3605: extfs: fix buffer overflow.
2016-03-20 11:55:38 +03:00
Andreas Mohr
e1ad66e90e Ticket #3605: extfs: fix buffer overflow.
When handling with copy/move commands inside of archive we can lead into buffer overflow
steps to roproduce:
    create simple 7z archive
    open it
    rename single filename
    hit buffer overflow

found by clang/AddressSanitizer

==17794==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000273593 at pc 0x00000045f2a9 bp 0x7ffc94aa8e20 sp 0x7ffc94aa85d0
READ of size 2 at 0x602000273593 thread T0
    #0 0x45f2a8 in __interceptor_strchr.part.44 (/usr/bin/mc+0x45f2a8)
    #1 0x70fb72 in extfs_find_entry_int /tmp/portage/app-misc/mc-9999/work/mc-9999/src/vfs/extfs/extfs.c:312:13
    #2 0x70f562 in extfs_find_entry /tmp/portage/app-misc/mc-9999/work/mc-9999/src/vfs/extfs/extfs.c:331:11
    #3 0x712131 in extfs_internal_stat /tmp/portage/app-misc/mc-9999/work/mc-9999/src/vfs/extfs/extfs.c:1117:13
    #4 0x7f3de308ab59 in mc_stat /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/vfs/interface.c:556:46
    #5 0x538575 in file_mask_dialog /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/filegui.c:1340:25
    #6 0x6e0753 in panel_operate /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/file.c:2718:13
    #7 0x6bdabd in rename_cmd /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/cmd.c:811:9
    #8 0x551ef4 in midnight_execute_cmd /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/midnight.c:1307:9
    #9 0x7f3de30a49e7 in buttonbar_callback /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/buttonbar.c:172:42
    #10 0x7f3de30b2305 in dlg_try_hotkey /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/dialog.c:464:23
    #11 0x7f3de30b199a in dlg_key_event /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/dialog.c:509:19
    #12 0x7f3de30b2ef9 in frontend_dlg_run /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/dialog.c:570:9
    #13 0x7f3de30b2af5 in dlg_run /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/dialog.c:1267:5
    #14 0x5507bb in do_nc /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/midnight.c:1827:9
    #15 0x50b874 in main /tmp/portage/app-misc/mc-9999/work/mc-9999/src/main.c:403:21
    #16 0x7f3de1ec78fb in __libc_start_main (/lib64/libc.so.6+0x208fb)
    #17 0x427f48 in _start (/usr/bin/mc+0x427f48)

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-03-20 11:54:52 +03:00
Andrew Borodin
787cea240f Merge branch '3606_shell_segfault'
* 3606_shell_segfault:
  (mc_shell_recognize_path): clarify duplicate comments
  Ticket #3606: fix segfault due to incorrect value of SHELL environment variable.
2016-03-17 09:24:45 +03:00
Yury V. Zaytsev
3b9087e8a3 (mc_shell_recognize_path): clarify duplicate comments
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-03-17 09:24:11 +03:00
Andrew Borodin
83b02196c8 Ticket #3606: fix segfault due to incorrect value of SHELL environment variable.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-03-17 09:24:11 +03:00
serpiph
b678d3b2fd Ticket #3618: update f90 syntax. 2016-03-16 09:36:26 +03:00
Andrew Borodin
b9810b5ba5 Merge branch '3620_patchfs_syntax_error'
* 3620_patchfs_syntax_error:
  Ticket #3620: patchfs: fix syntax error.
2016-03-16 09:24:25 +03:00
zazaho
48cfd3b28d Ticket #3620: patchfs: fix syntax error.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-03-16 09:23:34 +03:00
Yury V. Zaytsev
4e71328d7b Updated doc/NEWS file
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-03-12 17:20:56 +01:00
Yury V. Zaytsev
e52726963a Updated the hints translations from Transifex
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-03-12 17:07:07 +01:00
Yury V. Zaytsev
eae2a2542e Updated translations from Transifex
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-03-12 16:59:28 +01:00
Andrew Borodin
2623258322 Merge branch '3566_msg_notify'
* 3566_msg_notify:
  Clarify send of MSG_NOTIFY.
  Split MSG_ACTION into MSG_ACTION and MSG_NOTIFY.
  Ticket #3566: Split MSG_ACTION into MSG_ACTION and MSG_NOTIFY.
2016-03-12 14:50:15 +03:00
Andrew Borodin
8c9f359e89 Clarify send of MSG_NOTIFY.
(check_callback): update widget itself, then send MSG_NOTIFY to owner.
(radio_callback): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-03-12 14:49:40 +03:00
Mooffie
4e62be3b7e Split MSG_ACTION into MSG_ACTION and MSG_NOTIFY.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-03-12 14:49:40 +03:00
Mooffie
6b56cabf6f Ticket #3566: Split MSG_ACTION into MSG_ACTION and MSG_NOTIFY.
Start step: simplify buttonbar and menu handling.

We make WButtonBar send the command directly to the target widget. This
lets us simplify the MSG_ACTION case in dialog handlers. The menu handling
too is simplified here.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-03-12 14:49:39 +03:00
Yury V. Zaytsev
e213af27a6 Merge branch '3568_image_view_jpeg' 2016-03-12 10:54:16 +01:00
Andreas Mohr
65421dcac7 Ticket #3568: fix image view info for JPEG files
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-03-08 21:47:50 +01:00
Yury V. Zaytsev
5a39af1372 Merge branch '2947_quoting_in_user_menu' 2016-03-08 20:43:15 +01:00
Yury V. Zaytsev
fff8b4dd7a Delete outdated and unmaintained mc.menu.sr.in
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-03-08 20:43:05 +01:00
Andreas Mohr
becc0d01d0 Ticket #2947: mc.menu: quoting and whitespace fixes
`$*` must be quoted unless it's a command
`%*` must not quoted (already quoted)

1) quoting fixes
2) indentation fixes
3) `while` replaced by `for` loops
4) header comment (taken from source code)

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-03-08 20:43:05 +01:00
Andrew Borodin
b9a78aea36 Merge branch '3557_editor_not_close_ctrlg'
* 3557_editor_not_close_ctrlg:
  Ticket #3557: mcedit should not be closed on Ctrl-G.
2016-03-08 09:31:41 +03:00
Andrew Borodin
9a617a6d5a Ticket #3557: mcedit should not be closed on Ctrl-G.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-03-08 09:31:09 +03:00
Yury V. Zaytsev
ea2a33fbe5 maint: fetch tags on Travis before running the build
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-03-06 13:38:34 +01:00
Yury V. Zaytsev
4d5c1b2ad8 maint: simplify dist extension stripping in Travis build script
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-03-05 12:22:27 +01:00
Yury V. Zaytsev
b98cf5c2cb Merge branch '3601_without_internal_edit' 2016-03-04 18:18:02 +01:00
Yury V. Zaytsev
b84ac2c17b maint: add --enable-aspell to Travis build script
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-03-04 17:40:35 +01:00
Yury V. Zaytsev
87e81c91c1 maint: add --without-internal-edit and --without-diff-viewer to Travis build script
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-03-04 17:39:32 +01:00
Yury V. Zaytsev
8793b14bef Ticket #3601: fix ./configure --without-internal-edit
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-03-04 17:37:24 +01:00
Yury V. Zaytsev
b6c1c2fdba maint: run make dist on Travis, use tarball to do build tests
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-03-04 17:21:41 +01:00
Andrew Borodin
e8b68df26f Merge branch '3547_cleanup'
* 3547_cleanup: (61 commits)
  Update po/mc.pot.
  Remove unneeded `struct` keyword for typedef'd structs
  src/editor/edit.c: Cleanup some compiler warnings
  src/editor/editbuffer.c: Cleanup some compiler warning
  src/editor/editwidget.c: Cleanup some compiler warnings
  (etags_set_definition_hash): refactoring:
  Add -Wassign-enum compiler wirning.
  (widget_options_t): add W_DEFAULT value to cleanup -Wassign-enum warnings.
  Add three new compiler warnings:
  Cleanup -Wfloat-conversion warning.
  (edit_block_copy_cmd): cleanup -Wconditional-uninitialized warning.
  (edit_search_fix_search_start_if_selection): cleanup -Wlogical-not-parentheses warning.
  (mc_error_message): make output format translatable.
  Find File: clarify description of exit from panelize mode.
  WPanel should report MSG_NOT_HANDLED for unhandled commands.
  Sync with gnulib 781788eeb5d4d0b816698e8629300cd90a7379bd.
  lib/widget/input.c: (quote): change type to gboolean.
  (tree_chdir, sync_tree): take vfs_path_t object to avoid double conversion of path.
  (set_display_type): ret rid of string reduplication.
  (expand_format): ret rid of extra string duplication.
  ...
2016-03-04 09:28:56 +03:00
Andrew Borodin
efa8bc1777 Update po/mc.pot.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-03-04 09:28:16 +03:00
Yury V. Zaytsev
a8f512c12c Remove unneeded struct keyword for typedef'd structs
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-03-04 09:23:38 +03:00
Andreas Mohr
561923d643 src/editor/edit.c: Cleanup some compiler warnings
edit.c:909:12: warning: implicit conversion changes signedness: 'int' to 'unsigned long' [-Wsign-conversion]
    return r;
    ~~~~~~ ^
edit.c:1689:11: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
    col = edit_get_col (edit);
        ~ ^~~~~~~~~~~~~~~~~~~
edit.c:2361:17: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
            d = edit->undo_stack[(sp - 2) & edit->undo_stack_size_mask];
              ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
edit.c:2371:17: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
            d = edit->undo_stack[spm1];
              ~ ^~~~~~~~~~~~~~~~~~~~~~
edit.c:2440:17: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
            d = edit->redo_stack[(sp - 2) & edit->redo_stack_size_mask];
              ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
edit.c:2450:17: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
            d = edit->redo_stack[spm1];
              ~ ^~~~~~~~~~~~~~~~~~~~~~
edit.c:2970:27: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
                q = edit->curs_col;
                  ~ ~~~~~~^~~~~~~~

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-03-04 09:23:38 +03:00
Andreas Mohr
ae7dacb6f1 src/editor/editbuffer.c: Cleanup some compiler warning
editbuffer.c:428:12: warning: implicit conversion changes signedness: 'long' to 'gsize' (aka 'unsigned long') [-Wsign-conversion]
    *cut = cut_len;
         ~ ^~~~~~~
editbuffer.c:518:44: warning: implicit conversion loses integer precision: 'off_t' (aka 'long') to 'guint' (aka 'unsigned int') [-Wshorten-64-to-32]
        g_ptr_array_remove_index (buf->b2, i);
        ~~~~~~~~~~~~~~~~~~~~~~~~           ^
editbuffer.c:554:44: warning: implicit conversion loses integer precision: 'off_t' (aka 'long') to 'guint' (aka 'unsigned int') [-Wshorten-64-to-32]
        g_ptr_array_remove_index (buf->b1, i);
        ~~~~~~~~~~~~~~~~~~~~~~~~           ^

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-03-04 09:23:38 +03:00
Andreas Mohr
1b8a5d2196 src/editor/editwidget.c: Cleanup some compiler warnings
editwidget.c:808:12: warning: implicit conversion changes signedness: 'gboolean' (aka 'int') to 'cb_ret_t' [-Wsign-conversion]
    return ret;
    ~~~~~~ ^~~
editwidget.c:857:71: warning: implicit conversion changes signedness: 'unsigned char' to 'char' [-Wsign-conversion]
                    char_for_insertion = convert_from_8bit_to_utf_c2 ((unsigned char) x_key);
                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-03-04 09:23:37 +03:00
Andrew Borodin
a5ebb7d619 (etags_set_definition_hash): refactoring:
* type accuracy;
  * reduce variable scope;
  * trivial optimisation.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-03-04 09:23:37 +03:00
Andrew Borodin
4bd1008a03 Add -Wassign-enum compiler wirning.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-03-04 09:23:37 +03:00
Andreas Mohr
ea10f33dbb (widget_options_t): add W_DEFAULT value to cleanup -Wassign-enum warnings.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-03-04 09:23:37 +03:00
Andrew Borodin
cca1dd2ac3 Add three new compiler warnings:
Wconditional-uninitialized
Wfloat-conversion
Wlogical-not-parentheses

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-03-04 09:23:37 +03:00
Andreas Mohr
a482f38581 Cleanup -Wfloat-conversion warning.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-03-04 09:23:37 +03:00
Andreas Mohr
2a5b76b09b (edit_block_copy_cmd): cleanup -Wconditional-uninitialized warning.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-03-04 09:23:37 +03:00
Andreas Mohr
20ef10038f (edit_search_fix_search_start_if_selection): cleanup -Wlogical-not-parentheses warning.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-03-04 09:23:37 +03:00
Andrew Borodin
829738baa7 (mc_error_message): make output format translatable.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-03-04 09:23:37 +03:00
Andrew Borodin
1de0434c61 Find File: clarify description of exit from panelize mode.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-03-04 09:23:37 +03:00
Mooffie
0c1e480e05 WPanel should report MSG_NOT_HANDLED for unhandled commands.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-03-04 09:23:37 +03:00
Andrew Borodin
6a0767360d Sync with gnulib 781788eeb5d4d0b816698e8629300cd90a7379bd.
mountlist: recognize autofs-mounted remote file systems, too.

src/filemanager/mountlist.c (ME_REMOTE): Return true if a file system
i named "-hosts" because it is used by autofs to mount remote file
systems.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-03-04 09:23:37 +03:00
Andrew Borodin
4db17d31f9 lib/widget/input.c: (quote): change type to gboolean. 2016-03-04 09:23:37 +03:00
Andrew Borodin
a52cb840ae (tree_chdir, sync_tree): take vfs_path_t object to avoid double conversion of path.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-03-04 09:23:37 +03:00
Andrew Borodin
387f41f9ce (set_display_type): ret rid of string reduplication. 2016-03-04 09:23:37 +03:00