Commit Graph

13226 Commits

Author SHA1 Message Date
Andreas Mohr
47590152fa Ticket #3161: WListbox: remember focus state.
When listbox is updated, e.g. new file match add MSG_DRAW event is triggered
but currently listbox re-draw has no knowledge about right focus state.
Fix it by remember current focus state.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-08 12:49:30 +03: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
Mooffie
aa693fb0c3 Ticket #3569: various fixups in WListbox engine.
Ticket #3562: Listbox should fire MSG_ACTION on mouse clicks too.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-08 11:40:42 +03:00
Phil Friderici
b4c550e23e Add Puppet v4 & stdlib keywords
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-07 09:04:35 +03:00
Andrew Borodin
f7b360d5a0 Fix typo.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-03 15:39:57 +03:00
Andrew Borodin
bc200742d1 Indentation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-03 15:36:09 +03:00
Andrew Borodin
1fc5dd5986 Merge branch '3443_patch_xz'
* 3443_patch_xz:
  Ticket #3443: patchfs extfs: support xz compression.
2016-01-03 11:23:05 +03:00
Holger Bruenjes
d0435fcfee Ticket #3443: patchfs extfs: support xz compression.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-03 11:21:28 +03:00
Andrew Borodin
82e434de1d Merge branch '3527_uc1541'
* 3527_uc1541:
  Ticket #3527: uc1541 extfs: update version.
2016-01-03 10:50:05 +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
3468493968 Merge branch '3579_mcedit_buffer_overflow'
* 3579_mcedit_buffer_overflow:
  (edit_get_bracket): minor optimisation.
  Ticket #3579: (edit_get_bracket): fix buffer overflow.
2016-01-03 10:32:35 +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
Andrew Borodin
221c75c90e Merge branch '3509_man_not_portable'
* 3509_man_not_portable:
  Ticket #3509: fix not portable invocation of man.
2016-01-03 08:41:17 +03:00
Ranjan1018
7dc7eb3d14 Ticket #3509: fix not portable invocation of man.
mc called "man -l" to display man page files, which is not correct on OS X,
FreeBSD, etc, so patch out the -l to make it work.

Original patch: https://svnweb.freebsd.org/ports/head/misc/mc/files/patch-misc__ext.d__text.sh.in?annotate=382039&pathrev=382039

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-03 08:36:55 +03:00
Andrew Borodin
4d92e9191e Merge branch '3550_unset_mc_user'
* 3550_unset_mc_user:
  Ticket #3550: unset MC_USER.
2016-01-02 20:37:56 +03:00
Andreas Mohr
03ab1e49ac Ticket #3550: unset MC_USER.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-02 20:36:41 +03:00
Andrew Borodin
457bee3fd9 Merge branch '3523_tar_lz4'
* 3523_tar_lz4:
  Ticket #3523: support lz4 compress format.
2016-01-02 14:34:48 +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
Yury V. Zaytsev
a7ac983197 Merge branch 'eugenesan-golang-syntax' (MidnightCommander/mc#84) 2016-01-01 17:45:30 +04:00
Eugene San (eugenesan)
549efda171 mceditor: syntax: add golang
Based on http://go-lang.cat-v.org/text-editors/mcedit/
2016-01-01 17:44:26 +04:00
Andrew Borodin
d58ed4987a Merge branch '3547_cleanup'
* 3547_cleanup: (45 commits)
  Update po/*.po.
  Update copyright years.
  Robust sizeof() usage at function parameter and use memcpy destination sizeof...
  Remove unused function exec_shell().
  viewer: remove unused const value.
  diffviewer: use gboolean at WDiff struct.
  Clarify function declare at USE_DIFF_VIEW.
  (tree_store_load_from): optimise and fix return value.
  (tree_store_save): optimisation.
  cleanup gcc link time optimization warnings
  (tree_entry, TreeStore): use gboolean instead of bit fields.
  (edit_sort_cmd): fix memory leak.
  Ticket #3572: (edit_set_spell_lang): fix memory leak.
  (configure_panel_listing): fix memory leak.
  Ticket #3567: fix heap-use-after-free bug when accessing already freed widget object
  Use STR_E_NOTFOUND message where required.
  (listbox_key): remove redundant code.
  (extfs_find_entry_int): fix comparisons.
  (vfs_s_print_stats): avoid macros in i18n resources.
  Use signed long instead of unsigned long for binded actions.
  ...
2016-01-01 11:56:45 +03:00
Andrew Borodin
03ab9d8166 Update po/*.po.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:49:46 +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
Andreas Mohr
5f076e9e05 Ticket #3567: fix heap-use-after-free bug when accessing already freed widget object
Accessing widget object (at g_array_index loop) which was freed
already (item->quick_widget->u.input.label before at loop).

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
c5714eee34 Use STR_E_NOTFOUND message where required.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:08 +03:00
Mooffie
b6500f1dcc (listbox_key): remove redundant code.
This l->top calculation is already done in listbox_select_entry().

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
a3337615f6 (vfs_s_print_stats): avoid macros in i18n resources.
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