leaks home and leaks export
This commit is contained in:
parent
8c0116d52d
commit
4e4fd52670
@ -138,6 +138,7 @@ void check_home(t_s_cmd *cmd, char *p)
|
||||
if (chdir(p) == 0)
|
||||
if (find_it(cmd->big_cmd->env, "PWD") != -1)
|
||||
{
|
||||
if (find_it(cmd->big_cmd->env, "OLDPWD") != -1)
|
||||
cmd->big_cmd->env[old_pwd] = ft_strjoin("OLD", cmd->big_cmd->env[pwd]);
|
||||
cmd->big_cmd->env[pwd] = ft_strjoin("PWD=", p);
|
||||
}
|
||||
|
||||
@ -49,7 +49,9 @@ void print_export(char *tmp)
|
||||
i = 0;
|
||||
str1 = ft_substr(tmp, 0, find_len(tmp, i, '='));
|
||||
i = find_len(tmp, 0, '=') + 1;
|
||||
str2 = ft_substr(tmp, i, find_len(tmp, i, '\0'));
|
||||
str2 = ft_substr(tmp, i, ft_strlen(tmp));
|
||||
|
||||
// str2 = ft_substr(tmp, i, find_len(tmp, i, '\0'));
|
||||
printf("declare -x %s", str1);
|
||||
if (next_space(str2, 0) != '\0')
|
||||
printf("=\"%s\"", str2);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user