Commit Graph

13201 Commits

Author SHA1 Message Date
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
Andreas Mohr a3a78d9daf Fix compiler warning at search.c
search.c:56:12: warning: implicit conversion changes signedness: 'int' to 'mc_search_type_t' [-Wsign-conversion]
    {NULL, -1}
    ~      ^~
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:07 +03:00
Mooffie 106f80310d Remove outdated comment about refresh.
This comment was explanining a call to mc_refresh(). That call was
removed in commit 1f0b05b18. Keyboard events and mouse events are
nowadays the same: refresh is done after both.

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 897eac252f (WMenubar): fix -Wconversion warnings.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:07 +03:00
Andreas Mohr a613de7183 (gauge_callback): fix -Wconversion warnings.
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
Andrew Borodin 646b662eb0 (lock_get_info): type accuracies and related changes.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:07 +03:00
Andrew Borodin 4ce4c9b7dc Remove GLib-compatible code related to GLib < 2.26. 2016-01-01 11:48:06 +03:00
Mooffie 5fad7508c5 button_get_text() shouldn't return 'const'.
As it's a newly allocated string which the caller needs to free.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-01 11:48:06 +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
seyko 81f0b3c6e8 Fix current e-mail of seyko
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
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
Andrew Borodin 24d09babd8 Merge branch '3537_isofs_dotfiles'
* 3537_isofs_dotfiles:
  isofs: fix incorrect awk comparison operator
  Ticket #3537: isofs fix: do not skip all .dotfiles
2015-12-31 11:06:26 +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
Mooffie 2540595b0f Better subshell doc.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-12-31 10:57:09 +03:00
Andrew Borodin 72e20fce47 Merge branch '3543_mcview_not_found'
* 3543_mcview_not_found:
  (mcview_do_search): clarify seach start and end positions.
  (mcview_do_search): cleanup variables.
  Ticket #3543: mcview: "Not found" result isn't reported in some cases.
2015-12-31 10:50:37 +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