Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Benoit
minishell
Commits
a3a6cca2
Commit
a3a6cca2
authored
Jan 22, 2021
by
abenoit
Browse files
ambig redir correction
parent
c4f2c88f
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/ft_exit.c
View file @
a3a6cca2
...
...
@@ -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
"
);
...
...
src/parsing/parse_utils.c
View file @
a3a6cca2
...
...
@@ -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
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment