GRegex as PCRE wrapper was introduced in GLib-2.14. PCRE was required
for MC on OSes with GLib < 2.14. Currently MC requires GLib >= 2.32.
Since 2.73.2 (released at 2022-07-08), GRegex is based on PCRE2.
We can remove PCRE and PCRE2 from MC and use GLib only.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
...in non-fullscreen mode.
* (edit_end_page): fix count of lines from cursor down to bottom of
screen.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
* (edit_file_at_line): simplify. Make this function like
view_file_at_line(). Get rid of multiple directory readings after
close an external editor.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
do_executev() dereferences argv unconditionally. However,
execute_external_editor_or_viewer() may call do_executev() with NULL
argv, which causes a segfault.
This commit adds a check of argv for non-nullness.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Found in Alpine/musl on s390x, confirmed on aarch64 using valgrind - introduced
in 65a7278d8a:
{{{
==156518== Invalid read of size 1
==156518== at 0x413BE0: vfs_parse_ls_lga (parse_ls_vga.c:863)
==156518== by 0x4076C3: process_ls_line (mc_parse_ls_l.c:350)
==156518== by 0x4076C3: process_input (mc_parse_ls_l.c:376)
==156518== by 0x40736B: main (mc_parse_ls_l.c:404)
==156518== Address 0x536be6f is 1 bytes before a block of size 2 alloc'd
==156518== at 0x48854F0: malloc (vg_replace_malloc.c:446)
==156518== by 0x4CF4FCB: g_malloc (gmem.c:100)
==156518== by 0x4D0E99B: g_strdup (gstrfuncs.c:323)
==156518== by 0x413887: g_strdup_inline (gstrfuncs.h:321)
==156518== by 0x413887: vfs_parse_ls_lga (parse_ls_vga.c:848)
==156518== by 0x4076C3: process_ls_line (mc_parse_ls_l.c:350)
==156518== by 0x4076C3: process_input (mc_parse_ls_l.c:376)
==156518== by 0x40736B: main (mc_parse_ls_l.c:404)
}}}
https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/79071
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>