Ticket #4213: workaround to avoid crash on FreeBSD.

Previous fix 443a8106f1
makes the command line inaccessible if mc runs with
disabled subshell (mc -u).

This commit fixes the command line.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2021-07-03 18:59:38 +03:00
parent 7ef1925a98
commit 0e6721c32b

View File

@ -978,13 +978,13 @@ setup_cmdline (void)
return; return;
#ifdef ENABLE_SUBSHELL #ifdef ENABLE_SUBSHELL
/* Workaround: avoid crash on FreeBSD (see ticket #4213 for details) */
if (subshell_prompt == NULL)
return;
if (mc_global.tty.use_subshell) if (mc_global.tty.use_subshell)
{ {
tmp_prompt = g_string_free (subshell_prompt, FALSE); /* Workaround: avoid crash on FreeBSD (see ticket #4213 for details) */
if (subshell_prompt != NULL)
tmp_prompt = g_string_free (subshell_prompt, FALSE);
else
tmp_prompt = g_strdup (mc_prompt);
(void) strip_ctrl_codes (tmp_prompt); (void) strip_ctrl_codes (tmp_prompt);
} }
#endif #endif