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 <slavazanko@gmail.com>
This commit is contained in:
Alexander Kriegisch 2013-09-02 18:09:14 +03:00 committed by Slava Zanko
parent 2e651d00bd
commit 239f695d83

View File

@ -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);
}