Commit 3d792b7d authored by abenoit's avatar abenoit
Browse files

redir_types to AMBIG

parent 41cd5ae3
......@@ -66,7 +66,7 @@ static const char *err_msg(int err_code)
static int err_output(int err_code)
{
putstr_stderr("Error\n");
putstr_stderr("Error: ");
if (err_code == ARG_ERR || err_code == AMBIG_REDIR)
{
putstr_stderr(err_msg(err_code - 4));
......
......@@ -175,7 +175,7 @@ int parse_input(char **line, char **env, int stat_loc, t_command *command)
command->args = machine.args;
if (*line == NULL)
{
if (machine.redir_types[0] == TRUE)
if (machine.redir_types[0] == AMBIG)
return (AMBIG_REDIR);
return (FAILURE);
}
......
......@@ -164,8 +164,8 @@ int add_arg(t_state_machine *machine)
else if (machine->cur_token_stack == &machine->redir_paths)
{
machine->redir_types[0] = AMBIG;
free(machine->cur_arg);
machine->cur_arg = NULL;
free(machine->cur_arg); // Double free
machine->cur_arg = NULL; // Double free
return (FAILURE);
}
return (SUCCESS);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment