Commit Graph

1505 Commits

Author SHA1 Message Date
Andrew Borodin
2151edaff2 Get rid of global variables mc_main_config and mc_panels_config.
Use mc_global.main_config and mc_global.panels_congig instead.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-05-07 16:19:02 +03:00
Andreas Mohr
1c2060c28f (mc_realpath): cleanup cppcheck warning.
Cleanup following cppcheck warnings:

[lib/utilunix.c:1109]: (style) Unused variable: link_path.
[lib/utilunix.c:1113]: (style) Variable 'readlinks' is assigned a value that is never used.
[lib/utilunix.c:1114]: (style) Unused variable: n.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-05-07 16:19:02 +03:00
Andreas Mohr
67035605b9 lib/vfs/direntry.c: cleanup cppcheck warnings.
Cleanup following cppcheck warnings:

[lib/vfs/direntry.c:121]: (style) Clarify calculation precedence for '&' and '?'.
[lib/vfs/direntry.c:386]: (style) Clarify calculation precedence for '&' and '?'.
[lib/vfs/direntry.c:391]: (style) Clarify calculation precedence for '&' and '?'.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-05-07 16:19:02 +03:00
Andrew Borodin
80f138c1ba (mc_shell_get_installed_in_system): fix description.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-05-07 16:19:02 +03:00
Andrew Borodin
eecf1fc946 Fix typo.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-05-07 16:19:02 +03:00
Andrew Borodin
cae521c61d Clarify type cast in tgetsrt() calls.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-05-07 16:19:02 +03:00
Andrew Borodin
ccad69bccf Clarify type cast in SLtt_tgetsrt() calls.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-05-07 16:19:02 +03:00
Andrew Borodin
dcf2ac11c1 (dlg_set_top_or_bottom_widget): move to proper file section.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-05-07 16:19:02 +03:00
Andrew Borodin
bc14ff44c8 Remove min() and max() macros. Use MIN() and MAX() macros from GLib.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-05-07 16:19:02 +03:00
Andrew Borodin
0641e942e5 (input_is_empty): new WInput API.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-05-07 16:19:02 +03:00
Andrew Borodin
2d77cb32f9 lib/strutil/strutilutf8.c: grammar.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-05-07 16:19:02 +03:00
Andreas Mohr
eef076cef6 cppcheck: Cleanup Passing NULL after the last typed argument warning
Cleanup Passing NULL after the last typed argument warning.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-05-07 16:19:02 +03:00
Andreas Mohr
5a7d7d0087 (mouse_get_local): cleanup uninitialized warning.
Cleanup uninitialized warning with gcc compiler (gcc-4.4.7-4.el6).

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-05-07 16:19:02 +03:00
Andrew Borodin
8bb9605bfd VFS optimization: ret rid of double call of vfs_get_openfile() in file operations.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-05-07 16:19:02 +03:00
Andrew Borodin
623015eb0d (mc_closedir): fix NULL dereference.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-05-07 16:19:02 +03:00
Andrew Borodin
a9e5957196 (mc_fstat): fix function used to set up of errno value.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-05-07 16:19:02 +03:00
Andreas Mohr
284a19aff1 (find_widget_type): Make Solaris Studio happy
Make Solaris Studio 12.4 happy.

"dialog.c", line 1029: warning: argument #2 is incompatible with prototype:
        prototype: pointer to const void
        argument : pointer to function (...) returning enum (...)

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-05-07 16:19:02 +03:00
Yuri Khan
c1975a3a35 Do not duplicate alternate screen switching.
S-Lang already handles that in SLsmg_init_smg() and SLsmg_reset_smg().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-05-05 10:01:13 +03:00
Yuri Khan
abb4996589 Ticket #3640: Subshell cursor position lost after window resizing.
Refactoring: rename functions:

do_enter_ca_mode -> tty_enter_ca_mode
do_exit_ca_mode -> tty_exit_ca_mode

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-05-05 10:01:13 +03:00
Yury V. Zaytsev
0430ec719b Add csh to the list of fallback shell options
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-04-25 21:44:01 +02:00
Yury V. Zaytsev
6dfbebf71e Ticket #2742: detect csh as tcsh by name
Signed-off-by: Yury V. Zaytsev <yury.zaytsev@traveltainment.de>
2016-04-25 21:44:01 +02:00
Andrew Borodin
ba526badf2 (ST_BLKSIZE): fix signed and unsigned comparision.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-04-25 13:15:12 +03:00
Andrew Borodin
e7c01c7781 Ticket #2193: use Coreutils way to define buffer size to copy file.
m4.include/stat-size.m4, lib/stat-size.h: get these files from Gnulib.
src/filemanager/ioblksize.h: get this file from Coreutils.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-04-25 13:12:51 +03:00
Andrew Borodin
fde36f2d1a lib/charsets.[ch]: clarify usage of const qualifier.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-04-16 10:23:44 +03:00
Andreas Mohr
ff9d37cb8f lib/widget/input_complete.c: cleanup -Wcast-qual warning.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-04-16 10:23:44 +03:00
Andrew Borodin
ecfba8399c lib/widget/input.c: cleanup -Wcast-qual warning.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-04-16 10:23:44 +03:00
Andreas Mohr
68d7f53039 lib/widget/dialog.c: cleanup -Wcast-qual warning.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-04-16 10:23:44 +03:00
Andreas Mohr
a5cd35d11e lib/widget/buttonbar.c: cleanup -Wcast-qual warning.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-04-16 10:23:44 +03:00
Andreas Mohr
3231160d99 lib/vfs/path.c: cleanup some -Wcast-qual warning.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-04-16 10:23:44 +03:00
Andreas Mohr
9dddb0c78f lib/tty/tty-ncurses.c: cleanup -Wcast-qual warning.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-04-16 10:23:44 +03:00
Andreas Mohr
983ada66b0 lib/tty/key.c: cleanup -Wcast-qual warning.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-04-16 10:23:44 +03:00
Andrew Borodin
41035995c8 lib/strutil/{strutil8bit.c,strutilutf8.c}: cleanup -Wcast-qual warning.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-04-16 10:23:44 +03:00
Andreas Mohr
c0b60e274e lib/skin/ini-file.c: cleanup -Wcast-qual warning.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-04-16 10:23:44 +03:00
Andreas Mohr
f3f927c19e lib/search/regex.c: cleanup -Wcast-qual warning.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-04-16 10:23:44 +03:00
Andreas Mohr
0535ddddcc lib/search/lib.c: cleanup -Wcast-qual warning.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-04-16 10:23:43 +03:00
Andreas Mohr
97e370e396 lib/mcconfig/paths.c: cleanup -Wcast-qual warning.
Signed-off-by: Andreas Mohr <and@gmx.li>
2016-04-16 10:23:43 +03:00
Andreas Mohr
16f229114a Ticket #3598: cleanup some -Wcast-qual compiler warnings.
Introduce CONST_WIDGET helper and use it.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-04-16 10:23:43 +03:00
Mooffie
438e841226 Rename mouse.was_drag to mouse.last_msg.
Get rid of the 'click' variable.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-04-01 15:29:55 +03:00
Andrew Borodin
8490ca7be4 Drop old mouse API and use the new one.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-04-01 15:29:55 +03:00
Mooffie
781b810c13 Fix menu handling.
We now send mouse events to widgets in reverse Z-order, as done in common GUIs.
This makes it easy to implement "invisible" menubars correctly.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-04-01 15:29:55 +03:00
Andrew Borodin
c9a437a9c2 Optimize menu activation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-04-01 15:29:55 +03:00
Andrew Borodin
fa4e69b3b4 WMenuBar: execute menu item after drag action.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-04-01 14:16:08 +03:00
Mooffie
cae293b4d7 WMenuBar: a few mouse handling fixes. 2016-04-01 14:16:08 +03:00
Andrew Borodin
d974021678 WMenuBar: use the new mouse API.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-04-01 14:16:08 +03:00
Andrew Borodin
e8c6608fa5 WRadio: use the new mouse API.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-04-01 14:16:08 +03:00
Andrew Borodin
ebac1745bc WInput: use the new mouse API.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-04-01 14:16:08 +03:00
Andrew Borodin
30a56a9793 WCheck: use the new mouse API.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-04-01 14:16:08 +03:00
Andrew Borodin
23d5dbdf94 WButtonBar: use the new mouse API.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-04-01 14:16:08 +03:00
Andrew Borodin
1401f751cb WListbox: optimize mouse event processing.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-04-01 14:16:08 +03:00
Mooffie
70184b8a2d WListbox: use the new mouse API.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-04-01 14:16:08 +03:00
Mooffie
c678b58e23 WButton: use the new mouse API.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-04-01 14:16:08 +03:00
Andrew Borodin
192f01ebd2 Refactoring of high-level mouse API.
Decompose mouse event translation function: move mouse event handling
to separate function. This decomposition can be used for low-level
processing of high-level mouse events.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-04-01 14:16:08 +03:00
Andrew Borodin
b305deba64 Don't generate click event after drag action.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-04-01 14:16:08 +03:00
Andrew Borodin
cfd2c35241 (easy_mouse_translator): minor optimization. 2016-04-01 14:16:08 +03:00
Mooffie
03daa62e19 Ticket #3571: high-level mouse API.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-04-01 14:16:08 +03:00
Mooffie
0e89375772 Ticket #3617: (mc_open): handle varargs mode_t promotion issue.
On systems where 'mode_t' is smaller than 'int', doing 'va_arg (ap, mode_t)' is
wrong because of C's "default argument promotions". GCC 4 creates crashing code
in this case.

The "va_arg" page of Gnulib's manual describes the problem and a simple solution:

    https://www.gnu.org/software/gnulib/manual/html_node/va_005farg.html

However, since that solution reportedly (see thread at next link) still causes
GCC to print warnings (for no good reason; perhaps this was fixed in newer
GCCs), we pick a solution that defines a PROMOTED_MODE_T at the configuration
stage:

    https://lists.gnu.org/archive/html/bug-gnulib/2009-05/msg00231.html

(We take our 'mode_t.m4' from the most recent Gnulib source.)

(If any of the URLs above no longer works, simply search the web for the
mentioned words.)
2016-03-28 08:59:14 +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
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
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
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
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
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
4db17d31f9 lib/widget/input.c: (quote): change type to gboolean. 2016-03-04 09:23:37 +03:00
Andreas Mohr
9aeacda0d9 lib/vfs/direntry.c: remove unused variables.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-03-04 09:23:36 +03:00
Andrew Borodin
28ce7e566e (load_mc_home_file): return data length.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-03-04 09:23:36 +03:00
Andrew Borodin
c4258d453b Clarify AM_CPPFLAGS.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-03-04 09:23:36 +03:00
Andrew Borodin
be158faca6 filehighlight: clarify includes.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-03-04 09:23:36 +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
Andreas Mohr
842a723f9b Ticket #3269: only print meaningful error code.
Some error messages have no meaningful error code, don't display them.

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
98e66fe406 Ticket #3491: fix case insensitive search in non-unicode locales.
In non-unicode locales, search for non-latin symbols in any acharset was
case sensitive only.  This bug was introduced in
1a1496fc0d.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-02-02 09:37:15 +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
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
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
Andrew Borodin
f7b360d5a0 Fix typo.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-01-03 15:39:57 +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
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
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
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
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
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
99dd99172f Listbox: don't wraparound on mouse scroll.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-11-18 21:24:53 +03:00
Mooffie
e86072497f Ticket #3554: Listbox: don't wraparound on mouse scroll.
Initial commit: Listbox code cleanup.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-11-18 21:24:46 +03:00
Alexander Kriegisch
09ed02ea85 Minor code changes.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2015-11-10 11:55:38 +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
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
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
318df7b2e3 (prepend_error_and_exit): fix format. 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
a2fbfce123 (gauge_callback): fix draw of progress bar. 2015-11-05 14:32:53 +03:00
Andrew Borodin
e9db0a0c12 (vfs_canon): merge local variables. 2015-11-05 14:32:52 +03:00
Andrew Borodin
cb567b5ea6 (vfs_s_print_stats): get rid of static variables.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-11-05 14:32:52 +03:00
Andrew Borodin
69fb6b91be (i18n_checktimelength): minor optimization.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-11-05 14:32:52 +03:00
Andrew Borodin
4f45767601 (get_owner): change type of parameter and return value:
return value: from "char *" to "const char *";
parameter: from int to uid_t.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-11-05 14:32:52 +03:00
Andrew Borodin
a95320cb15 (get_group): change type of parameter and return value:
return value: from "char *" to "const char *";
parameter: from int to gid_t.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-11-05 14:32:52 +03:00
Andrew Borodin
615eba776d Ticket #3420: code cleanup before 4.8.15 release.
lib/strutil/*.c: apply template.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-11-05 14:32:51 +03:00
Egmont Koblinger
7cdb3e47c0 Ticket #3449: Segfault in "Find file" due to invalid UTF-8 sequences
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2015-10-18 19:26:42 +02:00
Egmont Koblinger
7e622158a2 Ticket #3530: viewer: highlight Find File's result.
Initial commit: (WLEntry): add free_data member to free or keep the data
on entry's removal.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-10-18 18:19:26 +02:00
Egmont Koblinger
1f0dee6b52 Ticket #3525: fix "Whole words" search.
The "Whole words" feature of search only worked in Normal mode, not in
any of the other modes (Regex, Hex, Wildcard).

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-09-19 20:26:31 +03:00
Egmont Koblinger
a0741b0a08 Ticket #3524: fix highliht of search result...
...in case of "Regular expression" and "Whole words".

The bug:
If there's no match, it's properly reported so.
If there's a match, however, the mcview's viewport is properly scrolled
vertically, but the search result is not highlighted. Plus, you can
press "Search again" once (or more times if there are multiple matches
in the line) and it won't progress to the next match.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-09-19 18:24:07 +03:00
Mooffie
b681f4bbef Ticket #3472: documentation for vfs/gc.c.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-06-18 21:13:49 +03:00
Andrew Borodin
21060c8ea7 (groupbox_callback): remove unused variable.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-05-24 20:16:56 +03:00
mooffie
ace07e4239 WGroupbox: respect dialog's colors.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-05-24 19:10:12 +03:00
Andreas Mohr
f023a83502 Ticket #3467: add -Wunreachable-code option and fix relative warnings.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-05-24 17:59:19 +03:00
Andreas Mohr
f1b73ffe6e Ticket #3465: add -Wmissing-variable-declarations option...
...and fix relative warnings.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-05-24 17:59:18 +03:00
Andreas Mohr
156bf097e2 Ticket #3464: (compute_namelen): remove...
...since DIRENT_LENGTH_COMPUTED is always 1.
compute_namelen() returns without functional logic.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-05-24 17:59:18 +03:00
Andrew Borodin
040be28e1b Ticket #3462: (WHLine): fix memory leak.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-05-24 17:59:18 +03:00
Andrew Borodin
a382b1558b Ticket #3420: code cleanup before 4.8.15 release.
Ticket #3457: (my_systemv_flags): fix memory leak.
(my_system_make_arg_array): ret rid of string duplications."

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-05-24 17:59:18 +03:00
Andrew Borodin
93d7856f85 (quick_dialog_skip): fix location of labeled input. 2015-05-24 17:51:39 +03:00
Andrew Borodin
17bbeb9791 Ticket #3456: SFTP VFS: fix segfault.
(mc_error_message): return error code for possible following use."
(sftpfs_cb_open_connection): fix dereference of null pointer.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-05-09 16:46:45 +03:00
Andrew Borodin
fd4d25ae27 (strip_ctrl_codes): add missing default case.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-05-03 20:12:18 +03:00
Andrew Borodin
2789e6e390 Ticket #3431: add missing default cases.
Introduce -Wswitch-default check.

Some minor cosmetics.

Thanks Andreas Mohr <and at gmx dot li> for original patch.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-05-03 19:43:50 +03:00
Andreas Mohr
4821259d85 Ticket #3437: (custom_canonicalize_pathname): fix heap-buffer-overflow.
Only use strncmp when path has enough room (greater then url_delim_len
size).
Overflow happen when path = './'.

(Found by AddressSanitizer.)

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-05-03 19:43:49 +03:00
Andreas Mohr
d74be13ef0 (file_date): fix variable initialization.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-05-03 19:43:49 +03:00
Andreas Mohr
e9e6868789 is_7bit_printable() is used only if support of charset selection and conversion is disabled. 2015-05-03 19:43:49 +03:00
Andreas Mohr
bd051e4095 lib/strutil/strutil8bit.c: remove unused functions.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-05-03 19:43:49 +03:00
Andrew Borodin
b698b7e834 Ticket #3435: clang compiler fixes/cleanups.
Since O_* macros are used in lib/global.h, include <fcntl.h> there.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-05-03 19:43:49 +03:00
Andreas Mohr
57452f656b Use #ifdef for autoconf provided marcos...
...until autoconf switch from un/define marco logic to always existing
macro with 0/1 value.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-05-03 19:43:48 +03:00
Andreas Mohr
d0d7d412a7 Better use of S_IS* macros.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-05-03 19:43:48 +03:00
Andreas Mohr
8a2f9e253d Ticket #3430: introduce -Wundef check to catch macro typos.
Use always defined MC_HOMEDIR_XDG macro.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-05-03 19:43:48 +03:00
Andrew Borodin
44bf7e8d80 reset_hp_softkeys variable is used in S-Lang-based mc only.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-05-03 19:43:48 +03:00
Andreas Mohr
ca95dec659 Ticket #3428: fix -Wredundant-decls compiler warnings...
...and use compiler option for future compile checks.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-05-03 19:43:48 +03:00
Andreas Mohr
7665a2a2e2 Ticket #3420: code cleanup before 3.4.15 release.
Ticket #3424: fix -Wdeclaration-after-statement compiler warnings.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-05-03 19:43:48 +03:00
Ben Woods
544a6b625e Ticket #3444: (mc_popen): use the PATH environment variable
...to search for the executable when opening pipe:
add the G_SPAWN_SEARCH_PATH flag to the g_spawn_async_with_pipes() call,
which cause mc to use the PATH environment variable to search for the
executable.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-04-19 15:29:39 +03:00
Egmont Koblinger
1a1496fc0d Ticket #3416: viewer case insensitive search doesn't find accents.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2015-03-19 11:16:24 +03:00
Andrew Borodin
8c88aa01ad Remove code required for GLib < 2.14.0.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-02-26 09:20:54 +03:00
Andrew Borodin
c08c90cd1b (input_execute_cmd): refactoring.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-02-26 09:20:53 +03:00
Andrew Borodin
42e7e39bd8 Add IS_PATH_SEP macro and use it.
Also massive use of PATH_SEP and PATH_SEP_STR macros.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-02-26 09:13:02 +03:00
Andrew Borodin
454479549c Update copyright years. 2015-02-26 09:12:08 +03:00
Andrew Borodin
6ed1eba88f (mc_search_regex_prepare_replace_str): refactoring.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-02-26 09:12:08 +03:00
Andrew Borodin
fa7d2ea110 lib/search/regex.c: use [] to get char in string. 2015-02-26 09:12:08 +03:00
Andrew Borodin
2c7dfe7341 (mc_search_prepare_replace_str2): make replace_str const.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-02-26 09:12:08 +03:00
Andrew Borodin
589d0bea0b (mc_search__regex_str_append_if_special): refactoring of loop and conditions.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-02-26 09:12:08 +03:00
Andrew Borodin
8ce85a419b Ticket #3265: code cleanup before 4.8.14 release.
(mc_search_regex__process_append_str): fix condition.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-02-26 09:12:07 +03:00
Boris Savelev
933fd255d0 Ticket #2743: File selection by patterns uses bytes instead of (unicode) characters.
Using the "?" pattern in the file selection dialog brought up with '+',
mc uses the file name length in bytes instead of characters.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2015-02-25 12:59:57 +03:00
Boris Savelev
6ca737d230 The patch does not intend to fix all Bash patterns (I believe mc never claimed to support all kinds of them), but it fixes some issues.
Namely, backslash-escaped metacharacter like {}*? will remain in the pattern (with the current code it is just stripped). Second, comma will be transformed to | only inside a group.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2015-02-24 14:58:51 +03:00
Andrew Borodin
96699b7eba Ticket #3390: fix backward word delete in input fields.
How to reproduce:
Either on the command line, or in any other text entry field (e.g. copy
file to) enter a string where the last word consists of one single
letter only. E.g. "abc de f".
Press Alt+Backspace.

Expected behavior: Remove the last word, that is, the letter "f" only,
leaving "abc de ".

Actual behavior: Yet another word is removed, leaving "abc ".

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-02-20 09:13:08 +03:00
Andreas Mohr
29d4afc657 Ticket #3404: fix order of old_colors table items.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-02-18 09:40:18 +03:00
Egmont Koblinger
89d2db5ca3 Ticket #3065: support of italic text.
Italic text is supported by S-Lang since pre2.3.0-107 and NCurses since 5.9.20130831.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-02-17 15:22:53 +03:00
Andrew Borodin
5ecf12483a Ticket #2952: search: fix zero-length substitution.
Problem:
Suppose you want to replace a substring in some file names with another,
so you do a File Rename operation with source pattern:

*OLDSTRING*

and target pattern:

\1NEWSTRING\2

If OLDSTRING occurs inside a filename, it is replaced correctly, but if
at the beginning or end of the filename, the corresponding zero-length
wildcard match is replaced by literal \1 or \2, respectively.

Expected
Wildcards that match a zero-length substring should be substituted with
an empty string.

Thanks boris<> for the original patch.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-01-14 09:50:50 +03:00
ginggs
8c1c48f61e Ticket #3333: fix g_error_new_valist().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-12-10 13:09:13 +03:00
Andrew Borodin
77a45cdafb lib/glibcompat.h: add missing include of stdarg.h.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-12-10 13:09:13 +03:00
Andrew Borodin
052ac838aa Add semicolon to the table of key code names.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-12-10 12:57:47 +03:00
Andrew Borodin
ce568de9b9 (name_quote): refactoring
...and related modifications.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-12-10 12:57:47 +03:00
Andrew Borodin
720f214482 (status_msg_init): repaint screen forced to remove previous finished dialog.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-10-03 13:19:26 +04:00
Andrew Borodin
81201b3022 status_msg_t: reimplement delay usage.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-10-03 13:19:25 +04:00
Andrew Borodin
89621050e3 (mc_time_elapsed): add new function to detect elapsed time intervals.
The author of initial patch is Egmont Koblinger.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-10-03 13:19:25 +04:00
Andrew Borodin
be938c611b Ticket #3247: refactoring of status_msg engine.
Initial commit: create global timer.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-10-03 13:19:25 +04:00
Paul Barker
e78b636eba Ticket #3267: mc fails to build against musl libc.
mc fails to build when using musl as the libc provider. This is due to
the CTRL() macro not being defined in <termios.h>. We could include
<sys/ttydefaults.h> explicitly but it's easier just to ensure CTRL is
defined.

This patch taken from the Sabotage Linux distro which fixes this. This
patch has also been tested and works with the OpenEmbedded build
system.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-10-01 15:19:54 +04:00
Andrew Borodin
a31b78003e Ticket #2966: fix view of broken manpages.
Initial commit: create MC pipe class to capture stdout and stderr of
spawn processes.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-09-27 20:24:12 +04:00
Ilia Maslakov
94a1c98aea Ticket #3228 (select/unselect files with the same extension as the current file)
Add Action 'SelectExt' for select/unselect files with the same extension as the current file.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2014-09-25 15:07:55 +04:00
Egmont Koblinger
a3d75ae300 Ticket #3241: colon was not recognized inside escape seq in prompt.
export PS1=$'\[\e[38:5:214m\]orange$\[\e[0m\]'
mc

Expected: "orange$" prompt shows up in black under the panels.
Actual: some additional garbage.

The 256-color and true-color escape sequences should allow either ';' or
':' inside as separator, actually, ':' is the more correct according to
ECMA-48. Some terminal emulators (e.g. xterm, gnome-terminal) support
this.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-09-03 11:31:14 +04:00
Andrew Borodin
d6004701cc Fix indentation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-09-02 15:57:56 +04:00
Veres Lajos
8d4d8d275f A few typofixes.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-09-02 15:32:36 +04:00
Andrew Borodin
6d82155270 Massive use of MC_PTR_FREE macro.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-09-02 15:32:36 +04:00
Andrew Borodin
de026dd1fc Add declaration of g_error_new_valist().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-09-02 15:32:36 +04:00
Andrew Borodin
4c27f7900c (input_event): fix handling of first mouse click. 2014-08-12 20:48:47 +04:00
Andrew Borodin
ddd336ad4d Ticket #3225: first Backspace/Delete ignored after mouse click in an input widget.
Initial commit: WInput: refactoring of text marking.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-08-03 14:54:16 +04:00
Andrew Borodin
a5488affc8 Indentation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-07-22 13:53:10 +04:00
Andrew Borodin
c672ed9b21 (label_set_textv): new WLabel API.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-07-22 13:40:30 +04:00
Andrew Borodin
9d4bafd889 (simple_status_msg_t): simple status message with label and 'Abort' button.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-07-22 13:40:30 +04:00
Andrew Borodin
55e604901f Create status dialog window to interrupt long-time operations.
Such dialog allows:
  * show status of operation;
  * control operation using dialog buttons (Abort, Suspend, Resume, etc).

Status dialog is raised after specified delay after operation start.
If operation duration is less than delay, the status dialog is not raised.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-07-22 13:40:30 +04:00
Andrew Borodin
62faec3a61 Ticket #2136: implement user-friendly interruption of long-time operations.
Initial step: created a simple timer.

Unlike GTimer, mc timer doesn't use a lot of multiplications and
divisions to convert seconds to nanoseconds and back. mc timer use only
multiplications to convert seconds to microseconds.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-07-22 13:40:30 +04:00
Andrew Borodin
e786d8266e (mouse_get_local): set Gpm_Event::modifiers only if libgpm is used.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-07-22 13:35:51 +04:00
Slava Zanko
512ad7d962 Make working with GError in more right way (like with exceptions).
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2014-07-22 13:12:07 +04:00
Andrew Borodin
f72cf464c9 (FileProgressStatus): change values to avoid overlapping with B_* values.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-07-22 13:12:07 +04:00
Andrew Borodin
478e58dfa2 (listbox_event): clarify check whether listbox is empty.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-07-22 13:12:07 +04:00
Andrew Borodin
e6030d8e74 Sync with gnulib 94ee038129c3b40510ef0ff6ac6ddfe85bf0f97f.
(xstrtoumax): use enum instead of 0, to pacify IRIX 6.5 cc.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-07-22 13:12:06 +04:00
Andrew Borodin
acf34eb98e (mc_config_get_string_list): clarify usage.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-07-22 13:12:06 +04:00
Andrew Borodin
725997c8d0 (mc_config_get_groups): optimization of function itself and usage.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-07-22 13:12:06 +04:00
Andrew Borodin
e62906473b (mc_config_get_keys): optimization of function itself and usage.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-07-22 13:12:06 +04:00
Andrew Borodin
8c040b46b8 (x_basename): fix dereference of null pointer.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-07-22 13:10:41 +04:00
Andrew Borodin
a6c5c82fa0 (str_ascii_fit_to_term): fix out-of-bound write.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-07-22 13:10:41 +04:00
Andrew Borodin
4e5819d169 (str_8bit_fit_to_term): fix out-of-bound write.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-07-22 13:10:41 +04:00
Andrew Borodin
708f474d1e (mc_search_regex__process_append_str): fix possible dereference of null pointer.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-07-22 13:10:41 +04:00
Andrew Borodin
e7252b6603 (lock_extract_info): fix out-of-bound writes.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-07-22 13:10:41 +04:00
Andrew Borodin
2d9cf4cad1 (vfs_s_get_line_interruptible): disable interrrupt after finish of read
...and type accuracies.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-07-22 13:10:41 +04:00
Andrew Borodin
76d61edc1e (mouse_get_local): initialize local.modifiers.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-07-22 13:10:40 +04:00
Andrew Borodin
db951c0d7e lib/widget/dialog-switch.c: fix the FSF name.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-07-22 13:10:40 +04:00
Slava Zanko
29f81d96c9 Ticket #3204: As user, I want to use own default colors for viewer.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2014-05-07 23:03:33 +03:00
Egmont Koblinger
976c18557e Ticket #3178: fix update of command line colors on skin change.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-03-27 16:41:02 +04:00
Egmont Koblinger
5b243eb9ea (dlg_set_size): clarify comment and hangling of DLG_TRYUP flag.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-03-24 16:20:41 +04:00
Andrew Borodin
be6b3889af Ticket #3173: fix location of popup windows upon screen resize.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-03-24 16:20:40 +04:00
Egmont Koblinger
a9d02894a1 Ticket #3180: remove DFF_FOLDER_COLOR. It's unused.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-03-16 17:14:54 +04:00
Egmont Koblinger
5943929956 Ticket #3183: diffviewer line drawing fix.
The "topmiddle" and "bottommiddle" characters are defined incorrectly
in many skins. This is because the correct definition wouldn't work
with S-Lang build. The only place these characters are used is the
diffviewer if either the +/- signs or the line numbers are shown,
enabled by pressing S or L. The correct definition of these characters
currently show up as 'v' and 'w' characters.

The fix makes the diffviewer use tty_print_alt_char() as it is being used
in other parts of the code, and hence it fixes the bug.
It also fixes the skin definitions.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-03-16 17:02:46 +04:00
Andrew Borodin
e5203cb023 Fix name of FSF in all *.c files.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-02-28 13:33:17 +04:00
Andrew Borodin
43bf10b170 Ticket #3167: copyright issues.
lib/strutil/xstrtol.c: restore copyright line.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-02-28 13:33:16 +04:00
Gergely Szász
2b6e440597 Ticket #3172: WListbox: fix of add item to the empty list.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-02-18 09:42:15 +04:00
Andrew Borodin
bf474e1241 Ticket #2165: basic version of the user-friendly skin selector.
Thanks Egmont Koblinger and Vitaliy Filippov for original patches.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-02-11 15:13:09 +04:00
Andrew Borodin
30ca8efd7c From ticket #3116: attempt to fix segfault while passing messages to widgets.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-02-10 16:27:03 +04:00
Eugene San (eugenesan)
198334ccc4 From ticket #3116: fix possible segfault when freeing a VFS.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-02-10 16:27:03 +04:00
Andrew Borodin
5e7e9ddf32 Ticket #3151: lib/global.h: remove declaration of refresh_screen().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-02-10 16:27:03 +04:00
Andrew Borodin
f0da49345a Collapse list of copyright years to ranges. Add 2014 year.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-02-10 16:27:03 +04:00
Andrew Borodin
d8b58c84be Ticket #3134: fix some inconsistencies in "Learn keys" UI.
Reorder keys in "Learn key" window in accordance with the order
of keys on regular keyboards.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-02-10 16:26:18 +04:00
Andrew Borodin
094fd0cd89 Use symbolic names for standard file descriptors.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-02-10 16:26:17 +04:00
Andrew Borodin
62e1606106 Fix segfault in directory hotlist.
(listbox_get_current): check parameter value before use it's member.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-01-22 13:59:54 +04:00
Andrew Borodin
7df67031a2 Refactoring of WListbox widget.
Use GQueue instead of GList to store listbox entries.

g_list_append() function is slow because it uses g_list_last()
internally to traverse from the beginning to the end of a list, so
forming a list of results has O(n*n) complexity instead of O(n).
GQueue contains pointers to head and tail of list and list length.
So in this case we don't need seach end of list every time when we
want append listbox entry to the listbox.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-01-14 14:13:38 +04:00
Egmont Koblinger
7866bf7342 Ticket #3093: keep symlinks in cwd at startup.
If you navigate in your shell to a directory containing symlinks and
then start mc, mc will show the canonical path instead. It would be nice
to make it show the directory with the symlinks.

Example: in your shell execute these:

user:~$ mkdir -p /tmp/a/b /tmp/x ; ln -s /tmp/a/b /tmp/x/y
user:~$ cd /tmp/x/y
user:/tmp/x/y$ mc

In mc you'll find yourself in /tmp/a/b, though it'd be nicer to see
/tmp/x/y at the top, and correspondingly navigating to the parent would
take you to /tmp/x.

If you start bash or zsh from /tmp/x/y, the new instance will start
displaying the working directory as such. They do this via the PWD env
variable. On one hand, they set and maintain PWD to point to the current
directory, using the path as specified by the user (possibly containing
symbolic links). On the other hand, they check its value at startup. If
$PWD points to the same physical directory as the actual working
directory then they use this value. If $PWD points somewhere else then
it's simply ignored (so it's a hint only as to which symlinks to use to
get to the working directory, but never alters the actual cwd).

Now mc also does the same at startup (with respect of "Cd follows
links" option). Relative directories specified in the command line  are
applied after possibly replacing the canonical cwd with $PWD. This way
for example

user:/tmp/x/y$ mc . ..

opens two panels in /tmp/x/y and /tmp/x instead of /tmp/a/b and /tmp/a
(whereas /tmp/x is actually a different directory than /tmp/a).

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-12-27 19:07:58 +04:00
Andrew Borodin
d870aedad1 Ticket #3114: fix broken build with NCurses.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-12-04 15:14:07 +04:00
Andrew Borodin
14973bfe79 Use AC_HEADER_MAJOR.
Instead of checking for sys/mkdev.h headerfile, there is the
AC_HEADER_MAJOR helper for how to get major(), minor(), makedev().

Sinc with GLib efb1701bf3baf6f5b05fd1a7a5a4ff990a7dc460.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-11-25 13:47:40 +04:00
Andrew Borodin
bb65b46790 Fix use of uninitialized memory in sigaction structure.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-11-25 13:47:40 +04:00
Andrew Borodin
377807c5de Fix search in internal viewer in case of nroff mode.
(mc_search__run_regex): fix conditions.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-11-25 13:47:40 +04:00
Andrew Borodin
29f6dd2a84 Use g_list_free_full().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-11-25 13:47:40 +04:00
Andrew Borodin
90dc6fffac Use g_slist_free_full().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-11-25 13:47:40 +04:00
Slava Zanko
0ed4a91d7d Reduce cppcheck warnings (style) in lib subdirectory.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-11-25 13:47:39 +04:00
Slava Zanko
0d489acd58 cppcheck: reduce variable scope.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-11-25 13:47:39 +04:00
Slava Zanko
a3b8a2f005 Use UTF8_CHAR_LEN instead of a magic number
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-11-25 13:47:39 +04:00
Slava Zanko
bd69b8dd31 Suppress cppcheck errors
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-11-25 13:47:39 +04:00
Slava Zanko
a57d45d590 Ticket #3098: vfs_path_from_str_flags() doesn't support VPF_STRIP_HOME
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-11-08 16:57:42 +03:00
Andrew Borodin
09f1818bed Ticket #3018: broken directory completion.
In the command line, the subdirectory completion in current directory
isn't performed if stub isn't starting with './'.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-11-07 21:23:43 +04:00
Andrew Borodin
c7b7a299e3 Ticket #3084: (dlg_init): fix order of messages sent to widgets during dialog initialization.
If checkbox is the first focusable widget in a dialog, it taken the MSG_DRAW
message after MSG_FOCUS one and therefore wasn't highlighted.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-11-07 15:59:26 +04:00
Andrew Borodin
5a61ac80d0 Refactoring of WInput history.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-11-07 15:53:53 +04:00
Andrew Borodin
de94164cb5 Remove WInput::field_width. Use Widget::cols instead.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-11-07 15:53:53 +04:00
Andrew Borodin
e16e33a186 (input_update): don't do anything if widget is unowned or is in inactive dialog.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-11-07 15:53:53 +04:00
Andrew Borodin
d8bb31c665 Ticket #3076: copy/move doesn't work if num_history_items_recorded=0.
How to reproduce:
1. Set num_history_items_recorded=0 in my $HOME/.config/mc/ini
2. Run mc.
3. Press F5 to copy and then enter.
Result: nothing happens.

Solution: refactoring of initial text usage in input line.
Use def_text to fill WInput:buffer when WInput is created.
Then overwrite WInput::buffer content from history if history usage
is enabled.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-11-07 15:53:53 +04:00
Andrew Borodin
5a04c1ede2 Indentation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:27:24 +04:00
Andrew Borodin
6a05f30ecf Clarify usage of SA_RESTART.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:09 +04:00
Andrew Borodin
c058e92586 Remove input_set_origin(). Use widget_set_size() instead.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:08 +04:00
Andrew Borodin
b0a793c420 (input_destroy): don't call input_free_completions() twice.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:08 +04:00
Andrew Borodin
61dc030772 More tests for canonicalize_pathname().
(custom_canonicalize_pathname): fix wrong condition. Remove redundant
break.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:08 +04:00
Andrew Borodin
e78b1fdf66 Remove redundant checks for g_strdup().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:08 +04:00
Andrew Borodin
034e973fbf (vfs_translate_path): return const char *.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:08 +04:00
Andrew Borodin
a6b3cc8f24 Typo.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:08 +04:00
Andrew Borodin
200cb115ab (widget_init): init pos_flags member to WPOS_KEEP_DEFAULT.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:07 +04:00
Andrew Borodin
0a784f4d2e (mc_search_regex__process_append_str): minor optimization and cosmetics.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:12:08 +04:00
Andrew Borodin
fbdf3adfbf (mc_search__cond_struct_new_regex_accum_append): minor optimization.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:12:08 +04:00
Andrew Borodin
d119439a1c (mc_search__conditions_free): use g_ptr_array_foreach().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:12:08 +04:00
Andrew Borodin
00f6272364 (mc_search__cond_struct_new_regex_hex_add): refactoring to get rid of extra memory allocation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:11:05 +04:00
Andrew Borodin
bb2f5d35f3 (mc_search__run_regex): optimization
...for case where there is no MC_SEARCH_CB_INVALID or MC_SEARCH_CB_SKIP
return codes (for search from file manager), so we can copy line
at regex buffer all at once.

Thanks Sergey Naumov <sknaumov@gmail.com> for the original patch.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:11:05 +04:00
Andrew Borodin
bb142bf47f (lookup_key): minor refactoring: replace while() by for().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:11:04 +04:00
Andrew Borodin
546e89f611 (vfs_path_tokens_get): minor refactoring: replace while() by for().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:11:04 +04:00
Andrew Borodin
f3bdcb186b (mc_skin_colors_old_configure_one): cosmetics.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:11:04 +04:00
Andrew Borodin
26fbddf6f4 (vfs_path_tokens_count): refactoring: get rid of extra memory allocation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:11:04 +04:00