From 0e6721c32b3a34ffe0ba7d1456b5400ff8b8aeec Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sat, 3 Jul 2021 18:59:38 +0300 Subject: [PATCH] Ticket #4213: workaround to avoid crash on FreeBSD. Previous fix 443a8106f1af55be2c995af10c4da80da430c2b1 makes the command line inaccessible if mc runs with disabled subshell (mc -u). This commit fixes the command line. Signed-off-by: Andrew Borodin --- src/filemanager/layout.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/filemanager/layout.c b/src/filemanager/layout.c index cedd23f0f..9118c7848 100644 --- a/src/filemanager/layout.c +++ b/src/filemanager/layout.c @@ -978,13 +978,13 @@ setup_cmdline (void) return; #ifdef ENABLE_SUBSHELL - /* Workaround: avoid crash on FreeBSD (see ticket #4213 for details) */ - if (subshell_prompt == NULL) - return; - 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); } #endif