S_IWRITE is an obsolete synonym provided for BSD compatibility.
It can be safely replaced with S_IWUSR.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Add two widget callbacks:
* (make_global): convert widget coordinates from local (relative to
owner) to global (screen).
* (make_local): convert widget coordinates from global (screen) to
local (relative to owner).
Such conversions are required when nested widgets and groups are added to
or removed from another groups.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
lib/widget/group.c: fix -Wcast-qual warnings:
group.c:199:21: warning: cast from 'const struct Widget *' to 'struct WGroup *' drops const qualifier [-Wcast-qual]
for (iter = GROUP (w)->widgets; iter != NULL; iter = g_list_next (iter))
^
../../lib/widget/group.h:16:29: note: expanded from macro 'GROUP'
^
group.c:231:21: warning: cast from 'const struct Widget *' to 'struct WGroup *' drops const qualifier [-Wcast-qual]
for (iter = GROUP (w)->widgets; iter != NULL; iter = g_list_next (iter))
^
../../lib/widget/group.h:16:29: note: expanded from macro 'GROUP'
^
group.c:263:21: warning: cast from 'const struct Widget *' to 'struct WGroup *' drops const qualifier [-Wcast-qual]
for (iter = GROUP (w)->widgets; iter != NULL; iter = g_list_next (iter))
^
../../lib/widget/group.h:16:29: note: expanded from macro 'GROUP'
^
Found by Clang-11.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
In the read_subshell_prompt() (src/subshell/common.c:1546) the first
call of select() returns 0. Therefore subshell_prompt is NULL.
NULL dereference is the cause of crash.
This commit isn't a real fix but just a workaround.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Use an empty patter (^$) that doesn't match any file name. In this
case, only the shebang is used to detect syntax highlighting rules for
OpenRC scripts.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
foot is a "fast, lightweight and minimalistic Wayland terminal emulator"
(see https://codeberg.org/dnkl/foot). Add its default TERM value to the
recognized ones. This enables mc to change the terminal window title and
handle mouse events.
(tty_check_term): add support of foot terminal emulator as xterm-compatible.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Alacritty is a "fast, cross-platform, OpenGL terminal emulator" (see
https://github.com/alacritty/alacritty). Add its default TERM value to
the recognized ones. This enables mc to change window title and handle
mouse events.
(tty_check_term): add support of alacritty terminal as xterm-compatible.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
version.sh: move from maint/utils to the root of the source tree
and make it a part of distributable tarball.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
If some small dialog (error message or password request) is displayed
before main mc window gets visible, the segfault occures.
The cause of segfault is update of prompt that is not created yet.
(setup_mc, create_file_manager): move creation of event channel from
setup_mc() to create_file_manager(), make that after creation of all
file manager widgets.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
...to fix segault introduced in daf21d8315.
Both actions MSG_INIT and MSG_DESTROY should be send to widget. In editor,
if file cannot be open, MSG_INIT isn't sent to, but MSG_DESTROY is. As a
result, a double free is occured in edit_dlg_deinit().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>