Browse Source

fixed parenthesis out of minish dir

master
narnaud 3 years ago
parent
commit
ce0f1a744c
  1. 3
      minishell.c
  2. 4
      parser.c

3
minishell.c

@ -6,7 +6,7 @@
/* By: mea <mea@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/05/02 12:14:09 by narnaud #+# #+# */
/* Updated: 2022/05/17 15:33:20 by mea ### ########.fr */
/* Updated: 2022/05/17 17:06:55 by narnaud ### ########.fr */
/* */
/* ************************************************************************** */
@ -82,6 +82,7 @@ int main(int argc, char **argv, char **envp)
datas.envp = ft_calloc(ENVP_MAX_SIZE, sizeof(char *));
while (*envp)
datas.envp[i++] = ft_strdup(*(envp++));
datas.envp[i] = ft_strjoin_with("MINISH=", "/minishell", getcwd(NULL, 0));
datas.exit_code = 0;
if (datas.silent)
{

4
parser.c

@ -6,7 +6,7 @@
/* By: mea <mea@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/05/02 16:09:25 by narnaud #+# #+# */
/* Updated: 2022/05/17 16:35:56 by narnaud ### ########.fr */
/* Updated: 2022/05/17 17:01:44 by narnaud ### ########.fr */
/* */
/* ************************************************************************** */
@ -68,7 +68,7 @@ static t_token *parse_cmd(t_datas *datas, t_token *tok, t_command *cmd)
if (tok->value[0] == '(')
{
cmd->argv[cmd->argc++] = ft_strdup("./minishell");
cmd->argv[cmd->argc++] = get_var_value(datas, "MINISH", 6);
cmd->argv[cmd->argc++] = ft_substr(tok->value,
1, ft_strlen(tok->value) - 2);
}

Loading…
Cancel
Save