diff --git a/src/subshell/common.c b/src/subshell/common.c index 8c7abc955..891d05ff9 100644 --- a/src/subshell/common.c +++ b/src/subshell/common.c @@ -272,7 +272,6 @@ static void init_subshell_child (const char *pty_name) { char *init_file = NULL; - char *putenv_str = NULL; pid_t mc_sid; (void) pty_name; @@ -343,10 +342,7 @@ init_subshell_child (const char *pty_name) input_file = mc_config_get_full_path (MC_INPUTRC_FILE); if (exist_file (input_file)) - { - putenv_str = g_strconcat ("INPUTRC=", input_file, (char *) NULL); - putenv (putenv_str); - } + g_setenv ("INPUTRC", input_file, TRUE); g_free (input_file); } @@ -365,9 +361,7 @@ init_subshell_child (const char *pty_name) } /* Put init file to ENV variable used by ash */ - putenv_str = g_strconcat ("ENV=", init_file, (char *) NULL); - putenv (putenv_str); - /* Do not use "g_free (putenv_str)" here, otherwise ENV will be undefined! */ + g_setenv ("ENV", init_file, TRUE); break; @@ -449,7 +443,6 @@ 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); }