mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-01 00:54:24 +03:00
(init_subshell_child): use g_setenv() instead of putenv().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
0c02118fad
commit
6903d15b97
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user