did some slight norming (200 lines of norminette and i'm not even done yet... :c)
This commit is contained in:
@ -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 */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
@ -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 */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
@ -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,12 +26,6 @@ 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)
|
||||||
@ -58,23 +52,18 @@ void exec_command_bonus(t_msh *msh, char *cmd_str)
|
|||||||
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)
|
||||||
@ -140,7 +127,8 @@ int get_cmd_count(t_cmd *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)
|
||||||
|
|| is_cmd_type(cmds)))
|
||||||
cmds = cmds->next;
|
cmds = cmds->next;
|
||||||
if (cmds && cmds->cmd_type == PIPE)
|
if (cmds && cmds->cmd_type == PIPE)
|
||||||
cmds = cmds->next;
|
cmds = cmds->next;
|
||||||
@ -151,14 +139,14 @@ 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);
|
||||||
@ -194,16 +182,16 @@ 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
|
||||||
|
&& msh->cmds->next->cmd_type == PAREN)))
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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 */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
@ -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)
|
||||||
|
@ -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,7 +88,8 @@ 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))
|
||||||
{
|
{
|
||||||
|
@ -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;
|
||||||
|
@ -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 */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
@ -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);
|
||||||
|
@ -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
|
||||||
|
@ -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,7 +42,7 @@ 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;
|
||||||
|
@ -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);
|
||||||
|
@ -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"
|
||||||
|
Reference in New Issue
Block a user