`AM_PROG_CC_C_O` is part of `AC_PROG_CC` since Automake 1.14, released in 2013
and we are almost in 2025 by now.
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
Starting with bash 5.1, PROMPT_COMMAND can be an array. Detect this
case and append an entry to the array instead of appending to a string.
Testing for bash >= 5 is sufficient, because the @a operator exists in
5.0. We need eval on the "then" branch because bash 1.x cannot even
parse that line (it does not support arrays).
Bug: https://bugs.gentoo.org/930401
Suggested-by: kfm@plushkava.net
Signed-off-by: Viorel Munteanu <ceamac@gentoo.org>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
Add a new variable to let fish know that -- since the parent commit
-- we are running a version where fish can use the kitty keyboard
protocol without breaking mc.
In a few years, both fish and mc should ideally remove this hack
(and fish should speak the kitty keyboard protocol unconditionally),
so no one should rely on this new variable except as a temporary
workaround. Hence the feature-specific flag and not a generic version
variable.
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
If a subshell (like fish 4.0) wishes to use "Disambiguate control keys"
from https://sw.kovidgoyal.net/kitty/keyboard-protocol/, ctrl-o sends
a multi-byte sequence. Let's make sure we can intercept that too so
we can suspend the shell.
Note that the shell already disables "Disambiguate control keys"
while it's suspended, so no other changes should be necessary.
Unfortunately there is one bug left: when I start "SHELL=$(which
fish) mc" and type `ctrl-o`, fish does not recognize CSI u bindings
(such as `bind ctrl-2 'echo hello'`) yet. It only works after the
second prompt. I haven't had time to figure that out.
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
Non-XPG4 version of `tail` fails if you call it as `tail -n 1`, but `tail -1`
works everywhere and is portable.
```
% ssh solaris
Last login: Sun Oct 20 12:20:56 2024 from 192.168.64.1
Oracle Solaris 11.4.42.111.0 Assembled December 2021
root@solaris:~# tail -n 1 .profile
usage: tail [+/-[n][lbc][f]] [file]
tail [+/-[n][l][r|f]] [file]
root@solaris:~# tail -1 .profile
root@solaris:~# head -n 1 .profile
root@solaris:~# head -1 .profile
root@solaris:~# /usr/xpg4/bin/tail -n 1 .profile
```
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
* 4600_filter_segfault:
src/filemanager/{achown,chattr,chmod,chown}.c: get rid of code duplication.
(panel_callback) [MSG_FOCUS]: remove self-draw here.
Disable all cursor movements if file panel is empty.
(start_search): don't start quick search if file panel is empty.
Clarify panel->currrent if file panel is empty.
Ticket #4600: fix segfault on panel filter.
* (panel_find_marked_file):
* (panel_get_marked_file): new WPanel APIs.
* Use these APIs in src/filemanager/{achown,chattr,chmod,chown}.c.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
* (panel_do_cd_int): set panel->current to -1 file list is empty.
* (panel_set_current_by_name): likewise.
* (panel_sized_with_dir_new): likewise.
* (panel_reload): likewise.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
mc segfaults if filter makes file panel empty.
* (panel_current_entry): improve. Add checks if panel->current is in
range of file list.
* A lot of changes to use modified panel_current_entry().
* (format_file):
* (display_mini_info): fix drawing of mini-status if file panel is
empty.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Non-Linux systems don't always name the user and group with uid/gid of 0
"root". On macOS group "wheel" has gid of 0 and group "root" doesn't exist. On
FreeBSD there is a user with gid of 0 named "toor". This causes user/group id
lookups in mc to fail and instead return the uid/gid of the current user.
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
* 4590_ext2attr_errno:
(copy_dir_dir): clarify get of mode and attributes of source directory.
file operations: rename actions and button names:
Clarify messages of get/set ext2 attributes errors.
Ticket #4590: clarify handling of ext2 attributes errors.
Don't show an error message if mc_fgetflags() and mc_fsetflags()
fails and errno set to ENOTSUP, EOPNOTSUPP, ENOSYS, and EINVAL.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
* 4598_tar_segfault:
tar: initialize variables passed to stoint().
(decode_num): simplify expression.
Ticket #4598: fix segfault on open TAR archive.
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>