space replace tab
This commit is contained in:
parent
4cb8ca86b9
commit
abb2e8563a
@ -6,7 +6,7 @@
|
||||
/* By: qmennen <qmennen@student.codam.nl> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/23 12:29:05 by Quinten #+# #+# */
|
||||
/* Updated: 2025/02/26 16:46:44 by qmennen ### ########.fr */
|
||||
/* Updated: 2025/02/26 16:57:02 by qmennen ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
||||
@ -1,49 +1,49 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* redirect_valid_type.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: Quinten <qmennen@student.codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2025/02/23 12:30:18 by Quinten #+# #+# */
|
||||
/* Updated: 2025/02/23 12:30:18 by Quinten ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* redirect_valid_type.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: qmennen <qmennen@student.codam.nl> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/23 12:30:18 by Quinten #+# #+# */
|
||||
/* Updated: 2025/02/26 16:56:51 by qmennen ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "minishell.h"
|
||||
#include "minishell.h"
|
||||
|
||||
int redirect_token_type(t_token *token)
|
||||
int redirect_token_type(t_token *token)
|
||||
{
|
||||
return (token->type == T_REDIRECT_IN
|
||||
|| token->type == T_HEREDOC
|
||||
|| token->type == T_REDIRECT_OUT
|
||||
|| token->type == T_APPEND_OUT);
|
||||
return (token->type == T_REDIRECT_IN
|
||||
|| token->type == T_HEREDOC
|
||||
|| token->type == T_REDIRECT_OUT
|
||||
|| token->type == T_APPEND_OUT);
|
||||
}
|
||||
|
||||
int redirect_is_valid(t_list *lst, t_token *token, int mode)
|
||||
{
|
||||
t_token *next;
|
||||
t_token *next;
|
||||
|
||||
if (!lst->next)
|
||||
return (0);
|
||||
next = (t_token *)lst->next->content;
|
||||
if (!next)
|
||||
if (!lst->next)
|
||||
return (0);
|
||||
next = (t_token *)lst->next->content;
|
||||
if (!next)
|
||||
{
|
||||
return (0);
|
||||
return (0);
|
||||
}
|
||||
if (mode >= 0 && access(next->value, mode) != 0)
|
||||
{
|
||||
error_msg("minishell", "unable to write to temp file");
|
||||
return (0);
|
||||
}
|
||||
return (redirect_token_type(token) && next->type < 3);
|
||||
return (redirect_token_type(token) && next->type < 3);
|
||||
}
|
||||
|
||||
int redirect_is_delimiter(t_token *token)
|
||||
{
|
||||
return (token->type == T_PIPE
|
||||
|| token->type == T_AND
|
||||
|| token->type == T_OR
|
||||
|| token->type == T_EOF
|
||||
|| token->type == T_ERROR);
|
||||
return (token->type == T_PIPE
|
||||
|| token->type == T_AND
|
||||
|| token->type == T_OR
|
||||
|| token->type == T_EOF
|
||||
|| token->type == T_ERROR);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user