mirror of
https://github.com/KeyZox71/ft_minipowershell.git
synced 2025-03-15 03:16:51 +01:00
「🔨」 fix: fix env in exec
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/04/29 13:20:22 by mmoussou #+# #+# */
|
||||
/* Updated: 2024/07/14 15:49:21 by mmoussou ### ########.fr */
|
||||
/* Updated: 2024/07/14 17:39:35 by adjoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -26,7 +26,7 @@ typedef struct s_exec
|
||||
int pipe_fd[2];
|
||||
} t_exec;
|
||||
|
||||
int format_quotes(t_list *list_cmd, t_env *env);
|
||||
int format_quotes(t_list *list_cmd);
|
||||
|
||||
char *get_path(char *path, char *cmd);
|
||||
int exec_split_cmd(t_list *list_cmd, t_env *env);
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/06/01 14:55:06 by mmoussou #+# #+# */
|
||||
/* Updated: 2024/07/14 15:48:41 by mmoussou ### ########.fr */
|
||||
/* Updated: 2024/07/14 20:13:30 by adjoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -86,6 +86,8 @@ int exec_single_cmd(t_cmd *cmd, char **env, t_env *env_t, int pipe_fd[2])
|
||||
fork_pid = fork();
|
||||
if (!fork_pid)
|
||||
__fork_single_cmd(cmd, env, env_t, exec);
|
||||
signal(SIGQUIT, SIG_IGN);
|
||||
signal(SIGINT, SIG_IGN);
|
||||
return (fork_pid);
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/07/03 10:50:52 by mmoussou #+# #+# */
|
||||
/* Updated: 2024/07/14 14:19:30 by adjoly ### ########.fr */
|
||||
/* Updated: 2024/07/14 17:39:18 by adjoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -21,7 +21,7 @@ char *format_quotes_string(char *cmd)
|
||||
return (cmd);
|
||||
}
|
||||
|
||||
int format_quotes_cmd(t_cmd *cmd, t_env *env)
|
||||
int format_quotes_cmd(t_cmd *cmd)
|
||||
{
|
||||
uint i;
|
||||
|
||||
@ -32,19 +32,18 @@ int format_quotes_cmd(t_cmd *cmd, t_env *env)
|
||||
while (cmd->argv[i])
|
||||
{
|
||||
cmd->argv[i] = format_quotes_string(cmd->argv[i]);
|
||||
cmd->argv[i] = env_var_replace(cmd->argv[i], env);
|
||||
i++;
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
int format_quotes(t_list *list_cmd, t_env *env)
|
||||
int format_quotes(t_list *list_cmd)
|
||||
{
|
||||
if (!list_cmd)
|
||||
return (0);
|
||||
while (list_cmd)
|
||||
{
|
||||
if (format_quotes_cmd(list_cmd->content, env))
|
||||
if (format_quotes_cmd(list_cmd->content))
|
||||
return (-1);
|
||||
list_cmd = list_cmd->next;
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/04/24 11:18:04 by adjoly #+# #+# */
|
||||
/* Updated: 2024/07/14 15:37:11 by adjoly ### ########.fr */
|
||||
/* Updated: 2024/07/14 17:27:40 by adjoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
Reference in New Issue
Block a user