Browse Source

fix parenthesis again

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

4
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 17:14:47 by narnaud ### ########.fr */
/* Updated: 2022/05/18 14:57:34 by narnaud@stude ### ########.fr */
/* */
/* ************************************************************************** */
@ -82,6 +82,8 @@ 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++));
if (!*get_var_value(&datas, "MINISH", 7))
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 17:14:15 by narnaud ### ########.fr */
/* Updated: 2022/05/18 14:58:51 by narnaud@stude ### ########.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++] = get_var_value(datas, "_", 2);
cmd->argv[cmd->argc++] = get_var_value(datas, "MINISH", 7);
cmd->argv[cmd->argc++] = ft_substr(tok->value,
1, ft_strlen(tok->value) - 2);
}

Loading…
Cancel
Save