Skip to content

Commit

Permalink
fixed exit status with no commands but redirs
Browse files Browse the repository at this point in the history
  • Loading branch information
lgrandco committed Mar 22, 2024
1 parent 1651333 commit 283dff1
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion srcs/builtins/ft_exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: legrandc <legrandc@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/10 18:29:44 by legrandc #+# #+# */
/* Updated: 2024/03/20 20:01:34 by legrandc ### ########.fr */
/* Updated: 2024/03/22 13:24:49 by legrandc ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down
2 changes: 1 addition & 1 deletion srcs/builtins/ft_export.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: legrandc <legrandc@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/10 18:28:24 by legrandc #+# #+# */
/* Updated: 2024/03/22 10:37:01 by legrandc ### ########.fr */
/* Updated: 2024/03/22 13:24:49 by legrandc ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down
2 changes: 1 addition & 1 deletion srcs/builtins/ft_pwd.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: legrandc <legrandc@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/10 18:27:58 by legrandc #+# #+# */
/* Updated: 2024/03/19 22:49:14 by legrandc ### ########.fr */
/* Updated: 2024/03/22 13:24:49 by legrandc ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down
4 changes: 2 additions & 2 deletions srcs/exec/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: legrandc <legrandc@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/08 15:41:04 by legrandc #+# #+# */
/* Updated: 2024/03/22 12:27:45 by legrandc ### ########.fr */
/* Updated: 2024/03/22 13:24:48 by legrandc ### ########.fr */
/* */
/* ************************************************************************** */

Expand All @@ -24,7 +24,7 @@ static int exec_child(t_vars *vars)
}
if (vars->cmd.len && is_builtin(vars))
vars->function(vars->cmd.args, vars);
else
else if (vars->cmd.len)
search_and_execve(vars);
clean_vars(vars);
exit(EXIT_SUCCESS);
Expand Down
2 changes: 1 addition & 1 deletion srcs/init/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: legrandc <legrandc@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/12 21:40:22 by legrandc #+# #+# */
/* Updated: 2024/03/22 10:58:43 by legrandc ### ########.fr */
/* Updated: 2024/03/22 13:24:49 by legrandc ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down
3 changes: 1 addition & 2 deletions srcs/path/path.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: legrandc <legrandc@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/10 17:59:30 by legrandc #+# #+# */
/* Updated: 2024/03/20 20:22:20 by legrandc ### ########.fr */
/* Updated: 2024/03/22 13:24:49 by legrandc ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -77,7 +77,6 @@ void search_and_execve(t_vars *vars)
err_squid(vars->cmd.path, true);
else
{
g_exit_status = 1;
if (turn_env_into_char(vars) == -1)
err_squid("Malloc error during env conversion", 0);
else
Expand Down
2 changes: 1 addition & 1 deletion srcs/signals/signals.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: legrandc <legrandc@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/13 13:15:49 by legrandc #+# #+# */
/* Updated: 2024/03/21 17:34:21 by legrandc ### ########.fr */
/* Updated: 2024/03/22 13:24:49 by legrandc ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down

0 comments on commit 283dff1

Please sign in to comment.