did some slight norming (200 lines of norminette and i'm not even done yet... :c)

This commit is contained in:
mdev9
2024-04-22 19:56:22 +02:00
parent 642a9ab232
commit e4df4a5655
15 changed files with 98 additions and 112 deletions

View File

@ -6,7 +6,7 @@
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */ /* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/05 18:20:21 by marde-vr #+# #+# */ /* Created: 2024/03/05 18:20:21 by marde-vr #+# #+# */
/* Updated: 2024/04/22 13:40:49 by marde-vr ### ########.fr */ /* Updated: 2024/04/22 19:39:03 by marde-vr ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View File

@ -6,7 +6,7 @@
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */ /* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/05 18:22:15 by marde-vr #+# #+# */ /* Created: 2024/03/05 18:22:15 by marde-vr #+# #+# */
/* Updated: 2024/04/19 14:42:50 by tomoron ### ########.fr */ /* Updated: 2024/04/22 19:32:11 by marde-vr ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View File

@ -6,7 +6,7 @@
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */ /* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/28 13:50:14 by tomoron #+# #+# */ /* Created: 2024/03/28 13:50:14 by tomoron #+# #+# */
/* Updated: 2024/04/22 19:18:52 by marde-vr ### ########.fr */ /* Updated: 2024/04/22 19:55:41 by marde-vr ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -26,28 +26,22 @@ void get_redirections(t_msh *msh, t_cmd *cmds)
if (!get_out_type(msh, cmds)) if (!get_out_type(msh, cmds))
get_in_type(msh, cmds); get_in_type(msh, cmds);
} }
/*
printf("in_type:");
print_cmd_type(msh->in_type, 0);
printf("\nout_type:");
print_cmd_type(msh->out_type, 0);
printf("\n");*/
} }
t_cmd *get_next_command(t_cmd *cmd) t_cmd *get_next_command(t_cmd *cmd)
{ {
while(cmd) while (cmd)
{ {
while(cmd && !is_operand_type(cmd)) while (cmd && !is_operand_type(cmd))
cmd = cmd->next; cmd = cmd->next;
if(cmd && cmd->cmd_type == AND && !g_return_code) if (cmd && cmd->cmd_type == AND && !g_return_code)
return(cmd->next); return (cmd->next);
if(cmd && cmd->cmd_type == OR && g_return_code) if (cmd && cmd->cmd_type == OR && g_return_code)
return(cmd->next); return (cmd->next);
if(cmd) if (cmd)
cmd = cmd->next; cmd = cmd->next;
} }
return(0); return (0);
} }
void exec_command_bonus(t_msh *msh, char *cmd_str) void exec_command_bonus(t_msh *msh, char *cmd_str)
@ -55,26 +49,21 @@ void exec_command_bonus(t_msh *msh, char *cmd_str)
t_cmd *cmds; t_cmd *cmds;
t_cmd *tmp; t_cmd *tmp;
if(!cmd_str) if (!cmd_str)
return ; return ;
cmds = parsing_bonus(cmd_str); cmds = parsing_bonus(cmd_str);
//print_parsed_cmd(cmds); // debug
tmp = check_cmds_syntax(cmds); tmp = check_cmds_syntax(cmds);
if (tmp) if (tmp)
{ {
print_syntax_error_bonus(tmp); print_syntax_error_bonus(tmp);
//printf("error\n"); // debug
free_cmd(cmds); free_cmd(cmds);
return ; return ;
} }
msh->cmds_head = cmds; msh->cmds_head = cmds;
while (cmds) while (cmds)
{ {
//print_parsed_cmd(cmds); // debug
msh->tokens = parse_cmds_to_token(cmds, msh->env); msh->tokens = parse_cmds_to_token(cmds, msh->env);
msh->cmds = cmds; msh->cmds = cmds;
//print_msh_struct(msh); // debug
//print_parsed_token(msh->tokens); // debug
exec_commands(msh); exec_commands(msh);
msh->in_fd = 0; msh->in_fd = 0;
msh->out_fd = 0; msh->out_fd = 0;
@ -89,14 +78,12 @@ int exec(t_msh *msh, char **cmd_args, int i, int cmd_count)
if (i != cmd_count - 1) if (i != cmd_count - 1)
{ {
//fprintf(stderr, "piping %d", i);
if (pipe(msh->fds[i]) == -1) if (pipe(msh->fds[i]) == -1)
{ {
perror("minishell: pipe"); perror("minishell: pipe");
free(cmd_args); free(cmd_args);
ft_exit(msh, 1); ft_exit(msh, 1);
} }
//fprintf(stderr, "pipe: msh->fds[%d][0]: %d, msh->fds[%d][1]: %d\n", i, msh->fds[i][0], i, msh->fds[i][1]);
} }
pid = fork(); pid = fork();
if (pid == -1) if (pid == -1)
@ -136,13 +123,14 @@ int get_cmd_count(t_cmd *cmds)
nb = 0; nb = 0;
while (cmds && !is_operand_type(cmds)) while (cmds && !is_operand_type(cmds))
{ {
while(cmds && (is_output_type(cmds) || is_input_type(cmds))) while (cmds && (is_output_type(cmds) || is_input_type(cmds)))
cmds=cmds->next; cmds = cmds->next;
if (is_cmd_type(cmds)) if (is_cmd_type(cmds))
nb++; nb++;
while(cmds && (is_output_type(cmds) || is_input_type(cmds) || is_cmd_type(cmds))) while (cmds && (is_output_type(cmds) || is_input_type(cmds)
cmds=cmds->next; || is_cmd_type(cmds)))
if(cmds && cmds->cmd_type == PIPE) cmds = cmds->next;
if (cmds && cmds->cmd_type == PIPE)
cmds = cmds->next; cmds = cmds->next;
} }
return (nb); return (nb);
@ -151,27 +139,27 @@ int get_cmd_count(t_cmd *cmds)
void print_signaled(int status) void print_signaled(int status)
{ {
int signal; int signal;
static const char *sigmsg[] = {0, "Hangup", 0, "Quit", \ static const char *sigmsg[] = {0, "Hangup", 0, "Quit", "Illegal \
"Illegal instruction", "Trace/breakpoint trap", "Aborted", "Bus error", \ instruction", "Trace/breakpoint trap", "Aborted", "Bus error",
"Floating point exception", "Killed", "User defined signal 1", \ "Floating point exception", "Killed", "User defined signal 1",
"Segmentation fault (skill issue)", "User defined signal 2", 0,\ "Segmentation fault (skill issue)", "User defined signal 2", 0,
"Alarm clock", "Terminated", "Stack fault" ,0 ,0, "Stopped", "Stopped",\ "Alarm clock", "Terminated", "Stack fault", 0, 0, "Stopped", "Stopped",
"Stopped", "Stopped", 0, "CPU time limit exceeded",\ "Stopped", "Stopped", 0, "CPU time limit exceeded",
"File size limit exceeded", "Virtual time expired",\ "File size limit exceeded", "Virtual time expired",
"Profiling timer expired","I/O possible", "Power failure",\ "Profiling timer expired", "I/O possible", "Power failure",
"Bad system call"}; "Bad system call"};
signal = WTERMSIG(status); signal = WTERMSIG(status);
if(signal < 31 && sigmsg[signal]) if (signal < 31 && sigmsg[signal])
{ {
ft_putstr_fd((char *)sigmsg[signal], 2); ft_putstr_fd((char *)sigmsg[signal], 2);
} }
if(signal >= 34 && signal <= 64) if (signal >= 34 && signal <= 64)
{ {
ft_putstr_fd("Real-time signal ", 2); ft_putstr_fd("Real-time signal ", 2);
ft_putnbr_fd(signal - 34, 2); ft_putnbr_fd(signal - 34, 2);
} }
if(WCOREDUMP(status)) if (WCOREDUMP(status))
ft_putstr_fd(" (core dumped)", 2); ft_putstr_fd(" (core dumped)", 2);
ft_putstr_fd("\n", 2); ft_putstr_fd("\n", 2);
g_return_code = signal + 128; g_return_code = signal + 128;
@ -194,17 +182,17 @@ void end_execution(t_msh *msh, int cmd_count)
free_fds(msh); free_fds(msh);
msh->pids = 0; msh->pids = 0;
free(msh->fds); free(msh->fds);
signal(SIGINT, signal_handler_interactive); //enables ctrl-C signal(SIGINT, signal_handler_interactive);
signal(SIGQUIT, signal_handler_interactive); signal(SIGQUIT, signal_handler_interactive);
set_echoctl(0); set_echoctl(0);
} }
int handle_parenthesis(t_msh *msh) int handle_parenthesis(t_msh *msh)
{ {
if(!(msh->cmds->cmd_type == PAREN || (msh->cmds->cmd_type == PIPE && msh->cmds->next->cmd_type == PAREN))) if (!(msh->cmds->cmd_type == PAREN || (msh->cmds->cmd_type == PIPE
return(0); && msh->cmds->next->cmd_type == PAREN)))
return (0);
return(1); return (1);
} }
void exec_commands(t_msh *msh) void exec_commands(t_msh *msh)

View File

@ -6,7 +6,7 @@
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */ /* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/18 18:29:20 by marde-vr #+# #+# */ /* Created: 2024/02/18 18:29:20 by marde-vr #+# #+# */
/* Updated: 2024/04/21 23:46:43 by tomoron ### ########.fr */ /* Updated: 2024/04/22 19:31:12 by marde-vr ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -41,33 +41,33 @@ t_env *export_set_env(t_env *env, char *name, char *value, int append)
t_env *tmp; t_env *tmp;
tmp = env; tmp = env;
if(!value) if (!value)
{ {
free(name); free(name);
ft_printf_fd(2, "minishell: malloc failed"); ft_printf_fd(2, "minishell: malloc failed");
return(env); return (env);
} }
while(tmp) while (tmp)
{ {
if(!ft_strcmp(name, tmp->name)) if (!ft_strcmp(name, tmp->name))
{ {
free(name); free(name);
if(!*value) if (!*value)
{ {
free(value); free(value);
return(env); return (env);
} }
if(append) if (append)
value = ft_strjoin_free(tmp->value, value, 2); value = ft_strjoin_free(tmp->value, value, 2);
if(!value) if (!value)
return(env); return (env);
free(tmp->value); free(tmp->value);
tmp->value = value; tmp->value = value;
return(env); return (env);
} }
tmp = tmp->next; tmp = tmp->next;
} }
return(env_add_back(env, name, value)); return (env_add_back(env, name, value));
} }
int ft_export(t_token *cmd, t_env *env) int ft_export(t_token *cmd, t_env *env)

View File

@ -6,7 +6,7 @@
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */ /* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/05 18:15:27 by marde-vr #+# #+# */ /* Created: 2024/03/05 18:15:27 by marde-vr #+# #+# */
/* Updated: 2024/04/22 19:12:50 by marde-vr ### ########.fr */ /* Updated: 2024/04/22 19:50:00 by marde-vr ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -27,7 +27,6 @@ void redirect_input(t_msh *msh, int i, char **cmd_args)
{ {
if (dup2(msh->fds[i - 1][0], 0) < 0) if (dup2(msh->fds[i - 1][0], 0) < 0)
{ {
perror("dup2"); //debug
free(cmd_args); free(cmd_args);
ft_exit(msh, 1); ft_exit(msh, 1);
} }
@ -82,7 +81,8 @@ int get_in_type(t_msh *msh, t_cmd *tokens)
if (open_input_file(msh, &cur_token)) if (open_input_file(msh, &cur_token))
return (1); return (1);
} }
if (cur_token && cur_token->next && !is_operand_type(cur_token->next) && cur_token->cmd_type != PIPE && cur_token->next->cmd_type != PIPE) if (cur_token && cur_token->next && !is_operand_type(cur_token->next)
&& cur_token->cmd_type != PIPE && cur_token->next->cmd_type != PIPE)
return (get_in_type(msh, cur_token->next)); return (get_in_type(msh, cur_token->next));
return (0); return (0);
} }

View File

@ -6,7 +6,7 @@
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */ /* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/04 17:31:38 by tomoron #+# #+# */ /* Created: 2024/02/04 17:31:38 by tomoron #+# #+# */
/* Updated: 2024/04/22 19:13:12 by marde-vr ### ########.fr */ /* Updated: 2024/04/22 19:30:03 by marde-vr ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -46,7 +46,6 @@ typedef struct s_cmd
struct s_cmd *next; struct s_cmd *next;
} t_cmd; } t_cmd;
typedef struct s_token typedef struct s_token
{ {
char *value; char *value;

View File

@ -6,7 +6,7 @@
/* By: tomoron <marvin@42.fr> +#+ +:+ +#+ */ /* By: tomoron <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/19 14:09:44 by tomoron #+# #+# */ /* Created: 2024/04/19 14:09:44 by tomoron #+# #+# */
/* Updated: 2024/04/22 19:12:32 by marde-vr ### ########.fr */ /* Updated: 2024/04/22 19:42:05 by marde-vr ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -21,7 +21,6 @@ void redirect_output(t_msh *msh, int i, char **cmd_args)
free(cmd_args); free(cmd_args);
ft_exit(msh, 1); ft_exit(msh, 1);
} }
} }
else else
{ {
@ -66,7 +65,8 @@ int get_out_type(t_msh *msh, t_cmd *cmds)
msh->out_fd = 0; msh->out_fd = 0;
ret = 0; ret = 0;
cur_cmd = cmds; cur_cmd = cmds;
while (cur_cmd && cur_cmd->next && (!is_cmd_type(cur_cmd) && !is_output_type(cur_cmd))) while (cur_cmd && cur_cmd->next && (!is_cmd_type(cur_cmd)
&& !is_output_type(cur_cmd)))
cur_cmd = cur_cmd->next; cur_cmd = cur_cmd->next;
while (cur_cmd && cur_cmd->next && !is_output_type(cur_cmd) while (cur_cmd && cur_cmd->next && !is_output_type(cur_cmd)
&& !is_operand_type(cur_cmd) && cur_cmd->cmd_type != PIPE) && !is_operand_type(cur_cmd) && cur_cmd->cmd_type != PIPE)
@ -85,5 +85,5 @@ int get_out_type(t_msh *msh, t_cmd *cmds)
} }
else if (cur_cmd && cur_cmd->cmd_type == PIPE) else if (cur_cmd && cur_cmd->cmd_type == PIPE)
msh->out_type = PIPE; msh->out_type = PIPE;
return(ret); return (ret);
} }

View File

@ -6,7 +6,7 @@
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */ /* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/09 15:26:01 by tomoron #+# #+# */ /* Created: 2024/02/09 15:26:01 by tomoron #+# #+# */
/* Updated: 2024/04/19 10:43:47 by tomoron ### ########.fr */ /* Updated: 2024/04/22 19:37:26 by marde-vr ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
#include "minishell.h" #include "minishell.h"
@ -88,14 +88,15 @@ t_token *parse_cmds_to_token(t_cmd *command, t_env *env)
t_token *new; t_token *new;
res = 0; res = 0;
while(command && (is_cmd_type(command) || is_output_type(command) || is_input_type(command))) while (command && (is_cmd_type(command) || is_output_type(command)
|| is_input_type(command)))
{ {
if(is_cmd_type(command)) if (is_cmd_type(command))
{ {
new = parse_tokens(command->value, env); new = parse_tokens(command->value, env);
res = add_token_back(res, new); res = add_token_back(res, new);
} }
command = command->next; command = command->next;
} }
return(res); return (res);
} }

View File

@ -6,7 +6,7 @@
/* By: tomoron <marvin@42.fr> +#+ +:+ +#+ */ /* By: tomoron <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/27 14:40:44 by tomoron #+# #+# */ /* Created: 2024/03/27 14:40:44 by tomoron #+# #+# */
/* Updated: 2024/04/19 10:40:51 by tomoron ### ########.fr */ /* Updated: 2024/04/22 19:38:45 by marde-vr ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -126,6 +126,7 @@ char *get_cmd_value(char **cmd, t_cmd_type type)
(*cmd)++; (*cmd)++;
return (res); return (res);
} }
void print_syntax_error_bonus(t_cmd *cmd) void print_syntax_error_bonus(t_cmd *cmd)
{ {
if (cmd->cmd_type == CMD || cmd->cmd_type == PAREN) if (cmd->cmd_type == CMD || cmd->cmd_type == PAREN)
@ -204,6 +205,7 @@ int get_next_arg_len(char *cmd)
} }
return (len); return (len);
} }
char *get_next_arg(char **cmd) char *get_next_arg(char **cmd)
{ {
int len; int len;

View File

@ -6,7 +6,7 @@
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */ /* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/09 15:24:36 by tomoron #+# #+# */ /* Created: 2024/02/09 15:24:36 by tomoron #+# #+# */
/* Updated: 2024/04/22 18:31:00 by tomoron ### ########.fr */ /* Updated: 2024/04/22 19:28:28 by marde-vr ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View File

@ -6,7 +6,7 @@
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */ /* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/05 18:17:25 by marde-vr #+# #+# */ /* Created: 2024/03/05 18:17:25 by marde-vr #+# #+# */
/* Updated: 2024/04/22 19:18:39 by marde-vr ### ########.fr */ /* Updated: 2024/04/22 19:49:36 by marde-vr ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -31,7 +31,6 @@ void execute_command(t_msh *msh, char **cmd_args)
{ {
char **env; char **env;
//if (cmd_is_forkable_builtin(msh->tokens->value))
if (exec_builtin(msh)) if (exec_builtin(msh))
{ {
free(cmd_args); free(cmd_args);
@ -43,7 +42,7 @@ void execute_command(t_msh *msh, char **cmd_args)
env = env_to_char_tab(msh->env); env = env_to_char_tab(msh->env);
if (env) if (env)
{ {
if(execve(msh->tokens->value, cmd_args, env)) if (execve(msh->tokens->value, cmd_args, env))
perror("execve"); perror("execve");
} }
ft_free_str_arr(env); ft_free_str_arr(env);

View File

@ -6,7 +6,7 @@
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */ /* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/22 14:31:13 by tomoron #+# #+# */ /* Created: 2024/03/22 14:31:13 by tomoron #+# #+# */
/* Updated: 2024/04/21 20:22:09 by tomoron ### ########.fr */ /* Updated: 2024/04/22 19:53:34 by marde-vr ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -57,14 +57,12 @@ int set_echoctl(int value)
{ {
struct termios t_p; struct termios t_p;
//ft_printf("echoctl value : %d\n",value); if (!isatty(1))
if(!isatty(1)) return (0);
return(0);
if (tcgetattr(1, &t_p)) if (tcgetattr(1, &t_p))
return (1); return (1);
if (((t_p.c_lflag & ECHOCTL) != 0) == value) if (((t_p.c_lflag & ECHOCTL) != 0) == value)
return (0); return (0);
//ft_printf("change\n");
if (value) if (value)
t_p.c_lflag = t_p.c_lflag | ECHOCTL; t_p.c_lflag = t_p.c_lflag | ECHOCTL;
else else

View File

@ -6,7 +6,7 @@
/* By: tomoron <marvin@42.fr> +#+ +:+ +#+ */ /* By: tomoron <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/17 09:12:33 by tomoron #+# #+# */ /* Created: 2024/04/17 09:12:33 by tomoron #+# #+# */
/* Updated: 2024/04/18 20:49:00 by marde-vr ### ########.fr */ /* Updated: 2024/04/22 19:30:43 by marde-vr ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -42,8 +42,8 @@ void sort_wildcards_token(t_token *list)
list = start; list = start;
while (list->next) while (list->next)
{ {
if (wildcard_cmp(list->value, list->next->value, if (wildcard_cmp(list->value, list->next->value, \
"zZyYxXwWvVuUtTsSrRqQpPoOnNmMlLkKjJiIhHgGfFeEdDcCbBaA9876543210") > 0) "zZyYxXwWvVuUtTsSrRqQpPoOnNmMlLkKjJiIhHgGfFeEdDcCbBaA9876543210") > 0)
{ {
swap = list->value; swap = list->value;
list->value = list->next->value; list->value = list->next->value;

View File

@ -6,7 +6,7 @@
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */ /* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/05 18:19:26 by marde-vr #+# #+# */ /* Created: 2024/03/05 18:19:26 by marde-vr #+# #+# */
/* Updated: 2024/04/22 16:43:31 by tomoron ### ########.fr */ /* Updated: 2024/04/22 19:53:16 by marde-vr ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -45,7 +45,6 @@ void free_msh(t_msh *msh)
void ft_exit(t_msh *msh, int exit_code) void ft_exit(t_msh *msh, int exit_code)
{ {
//ft_printf("exiting");
set_echoctl(msh->echoctl); set_echoctl(msh->echoctl);
free_msh(msh); free_msh(msh);
exit(exit_code); exit(exit_code);

View File

@ -6,7 +6,7 @@
/* By: tomoron <marvin@42.fr> +#+ +:+ +#+ */ /* By: tomoron <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/15 12:53:29 by tomoron #+# #+# */ /* Created: 2024/04/15 12:53:29 by tomoron #+# #+# */
/* Updated: 2024/04/19 10:55:20 by tomoron ### ########.fr */ /* Updated: 2024/04/22 19:28:13 by marde-vr ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
#include "minishell.h" #include "minishell.h"