Commit a3a6cca2 authored by abenoit's avatar abenoit
Browse files

ambig redir correction

parent c4f2c88f
......@@ -58,7 +58,7 @@ static const char *err_msg(int err_code)
"Minishell takes no argument",
"Memory allocation failure",
"Cannot write on standard output",
"Cannot read standard input (GNL error)"
"Cannot read standard input (GNL error)",
"Ambiguous redirection"};
return (msg[err_code]);
......@@ -67,7 +67,7 @@ static const char *err_msg(int err_code)
static int err_output(int err_code)
{
putstr_stderr("Error\n");
if (err_code == ARG_ERR)
if (err_code == ARG_ERR || err_code == AMBIG_REDIR)
{
putstr_stderr(err_msg(err_code - 4));
putstr_stderr("\n");
......
......@@ -165,6 +165,7 @@ int add_arg(t_state_machine *machine)
{
machine->ambig_redir = TRUE;
free(machine->cur_arg);
machine->cur_arg = NULL;
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