From 239f695d832e83c57ea8bd8e26f3406d4cb5cee8 Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Mon, 2 Sep 2013 18:09:14 +0300 Subject: [PATCH] Ticket #2742: [Subshell] Support for ash + bugfixes for bash, fish Fix non-functional INPUTRC for bash (variable was unset and never used) Signed-off-by: Slava Zanko --- src/subshell.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/subshell.c b/src/subshell.c index 511dad1d6..6c08d66f7 100644 --- a/src/subshell.c +++ b/src/subshell.c @@ -209,6 +209,7 @@ static void init_subshell_child (const char *pty_name) { char *init_file = NULL; + char *putenv_str = NULL; pid_t mc_sid; (void) pty_name; @@ -257,8 +258,10 @@ init_subshell_child (const char *pty_name) switch (subshell_type) { case BASH: + /* Do we have a custom init file ~/.local/share/mc/bashrc? */ init_file = mc_config_get_full_path ("bashrc"); + /* Otherwise use ~/.bashrc */ if (access (init_file, R_OK) == -1) { g_free (init_file); @@ -273,9 +276,8 @@ init_subshell_child (const char *pty_name) char *input_file = mc_config_get_full_path ("inputrc"); if (access (input_file, R_OK) == 0) { - char *putenv_str = g_strconcat ("INPUTRC=", input_file, NULL); + putenv_str = g_strconcat ("INPUTRC=", input_file, NULL); putenv (putenv_str); - g_free (putenv_str); } g_free (input_file); } @@ -341,6 +343,7 @@ init_subshell_child (const char *pty_name) /* If we get this far, everything failed miserably */ g_free (init_file); + g_free (putenv_str); my_exit (FORK_FAILURE); }