make norminette happy(er)
This commit is contained in:
parent
526eba189e
commit
f6c2754882
@ -27,5 +27,4 @@ int builtin_router(t_minishell *msh, t_command *cmd)
|
||||
if (is_builtin(cmd->args[0]) < 0)
|
||||
return (FALSE);
|
||||
return (builtin_fn[is_builtin(cmd->args[0])](msh, cmd));
|
||||
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ void environment_print(t_minishell *msh, int export)
|
||||
t_environment *env;
|
||||
|
||||
env_list = msh->environment;
|
||||
while(env_list != NULL)
|
||||
while (env_list != NULL)
|
||||
{
|
||||
env = (t_environment *)env_list->content;
|
||||
if (export)
|
||||
|
||||
@ -24,7 +24,7 @@ static int is_dir(char *path)
|
||||
return (S_ISDIR(path_stats.st_mode));
|
||||
}
|
||||
|
||||
static int validate_executable_path(char *path)
|
||||
static int validate_executable_path(char *path)
|
||||
{
|
||||
if (access(path, X_OK) < 0)
|
||||
{
|
||||
|
||||
@ -34,7 +34,7 @@ static int execute_builtin(t_minishell *msh, t_command *cmd)
|
||||
return (exit_status);
|
||||
}
|
||||
|
||||
static int executor_execute_command(t_minishell *msh, t_command *cmd)
|
||||
static int executor_execute_command(t_minishell *msh, t_command *cmd)
|
||||
{
|
||||
if (is_builtin(cmd->args[0]) >= 0)
|
||||
msh->exit_status = execute_builtin(msh, cmd);
|
||||
|
||||
@ -41,6 +41,5 @@ t_list *ft_parse_input(t_minishell *msh)
|
||||
break ;
|
||||
}
|
||||
}
|
||||
// ft_token_free(msh, token);
|
||||
return (list);
|
||||
}
|
||||
|
||||
@ -30,7 +30,6 @@ static int calculate_word_len(t_minishell *msh, t_lexer *lexer)
|
||||
i = lexer->pos;
|
||||
while (is_word_char(lexer->input[i]))
|
||||
{
|
||||
|
||||
len++;
|
||||
i++;
|
||||
}
|
||||
@ -67,8 +66,6 @@ char *lexer_readword(t_minishell *msh, t_lexer *lexer)
|
||||
qts = (c == '"' || c == '\'');
|
||||
if (qts)
|
||||
return (lexer_parse_quotes(msh, lexer));
|
||||
// if (!match_quotes(msh, lexer, qts))
|
||||
// return (NULL);
|
||||
len = calculate_word_len(msh, lexer);
|
||||
word = read_word(msh, lexer, len);
|
||||
return (word);
|
||||
|
||||
@ -22,7 +22,6 @@ t_command *parser_alloc_command(t_minishell *msh)
|
||||
command->fd_out = 1;
|
||||
command->redirect_in = NULL;
|
||||
command->redirect_out = NULL;
|
||||
// command->environment = NULL;
|
||||
command->n_fds = 0;
|
||||
return (command);
|
||||
}
|
||||
|
||||
@ -34,5 +34,3 @@ int parser_count_arguments(t_list *list)
|
||||
}
|
||||
return (cmds);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -20,7 +20,7 @@ void history_write(char *line)
|
||||
fd = open(".minishell_history", O_WRONLY | O_APPEND | O_CREAT, 0644);
|
||||
if (fd < 0)
|
||||
return ;
|
||||
// if (*line)
|
||||
// ft_putendl_fd(line, fd);
|
||||
if (*line)
|
||||
ft_putendl_fd(line, fd);
|
||||
close(fd);
|
||||
}
|
||||
|
||||
@ -15,8 +15,9 @@
|
||||
void *malloc_safe(t_minishell *msh, size_t size)
|
||||
{
|
||||
void *ptr;
|
||||
|
||||
if (size == 0)
|
||||
return (NULL);
|
||||
return (NULL);
|
||||
ptr = malloc(size);
|
||||
check_malloc(msh, ptr);
|
||||
return (ptr);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user