* 3641_cleanup:
lib/mcconfig/paths.c: reduce scope of 'homedir' var.
lib/mcconfig/paths.c: cleanup.
doc/man/mc.1.in: fix substitution markers.
src/vfs/fish/fish.c: apply coding guidelines.
More use link_isdir().
Get rid of #define const_cast().
Fix typos.
Define NCURSES_CONST if curses library doesn't define it.
(ftpfs_open_data_connection): fix enable/disable interrupt key.
(ftpfs_open_data_connection): fix socket leak in case of unsuccessful ftp connection.
(dlg_adjust_position): refactoring.
Ticket #3641: code cleanup before 4.8.18 release.
To ensure that nobody uses the 'homedir' variable in the future without
initializing it first, we make it private to the function, thereby effectively
removing it.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
We can conclude, by reading their GLib source[1], by their documentation,
and by looking at how popular programs use them[2], that the functions
g_get_user_{config,cache,data}_dir() don't return a NULL or empty string.
So the handling of this case can go.
[1] https://git.gnome.org/browse/glib/tree/glib/gutils.c
[2] E.g., google "g_get_user_data_dir".
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This is an initial support of GLSL syntax highlight for mcedit.
Keyword and and built-in function lists are based on glsl-mode.el
from emacs (which is originally written by Xavier Decoret and
Jim Hourihan).
Supports GLSL 4.5.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
...after changing VFS in the passive one.
Steps to reproduce:
1. Make left panel active.
2. Press F9 to open menu, select 'Right', then 'FTP link...'
3. Insert a valid FTP URL and press OK (or Enter). Wait for finish of FTP
directory reading.
4. Left panel is still active. Try to change CWD here by pressing Enter
or using command line.
Result: error messages 'ftpfs: CWD failed' and 'Cannot change directory'
or 'Cannot chdir to...'.
The problem: when VFS is changed in the passive panel, VFS CWD is
changed accordingly. Then active panel tries use the new VFS CWD.
The solution: restore VFS CWD after changing VFS in the passive panel.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
* 3641_cleanup: (23 commits)
Cleanup unused macros.
(mc_search__translate_replace_glob_to_regex): cleanup compile warning.
mcedit: syntax: associate node executables with JavaScript syntax.
(mc_ctl): join conditions.
(vfs_strip_suffix_from_filename): refactoring.
lib/tty/key.h: remove declaration of unimplemented function.
Fix default shortcut for "HotList" command.
(vfs_setup_cwd): move directory test to separate function.
(setup_panels): clarify panel size caclulation.
(panel_update_cols): move from panel.c to layout.c.
(tree_move): support VFS.
(check_callback): clean unneeded type casting.
Refactoring of widget's position and size calculation.
Refactoring of dialog's position and size calculation.
Ticket #3562: fix Glib-critical asserts in empty WListbox.
(mc_search_set_error): cleanup compile warning on older gcc compilers:
Find file: fix directory search order to be depth-first again.
(variable_completion_function): cleanup Wconditional-uninitialized warning.
Minor refactoring of mc shutdown.
(make_symlink): trivial refactoring.
...
glob.c:143:21: warning: implicit conversion loses integer precision: 'int' to 'char' [-Wconversion]
c = ++cnt;
~ ^~~~~
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
search.c: In function 'mc_search_set_error':
search.c:497:36: error: declaration of 'mc_search' shadows a global declaration [-Werror=shadow]
search.c:419:1: error: shadowed declaration is here [-Werror=shadow]
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
input_complete.c:383:42: error: variable 'p' may be uninitialized when used here [-Werror,-Wconditional-uninitialized]
temp = g_string_new_len (*env_p, p - *env_p);
^
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Move calls of disable_mouse() and disable_bracketed_paste()
to main() because init_mouse() and enable_bracketed_paste()
are called here.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
The code that manipulates the ncurses backend into changing
the key combination to generate SIGINT from CTRL-c to CTRL-g does
so by accessing undocumented internal ncurses data structures.
This breaks compilation with netbsd-curses[0], and could also break
when the ncurses author decides to change internal structures in a
future release.
Fix it by using a portable approach that works everywhere using libc
primitives instead.
[0] https://github.com/sabotage-linux/netbsd-curses
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>