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
3d792b7d
Commit
3d792b7d
authored
Jan 22, 2021
by
abenoit
Browse files
redir_types to AMBIG
parent
41cd5ae3
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/ft_exit.c
View file @
3d792b7d
...
...
@@ -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
));
...
...
src/parsing/parse_input.c
View file @
3d792b7d
...
...
@@ -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
);
}
...
...
src/parsing/parse_utils.c
View file @
3d792b7d
...
...
@@ -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
);
...
...
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