clean: norm part2 (FINAL)
This commit is contained in:
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* syntatics.c :+: :+: :+: */
|
||||
/* syntax.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/02/21 13:00:05 by cchauvet #+# #+# */
|
||||
/* Updated: 2023/02/21 23:40:20 by cchauvet ### ########.fr */
|
||||
/* Updated: 2023/03/28 16:37:29 by cchauvet ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -26,16 +26,14 @@ static int ft_quote_verif(const char *str)
|
||||
|
||||
static int ft_pipe_is_alone(const char *str)
|
||||
{
|
||||
size_t i;
|
||||
ssize_t i;
|
||||
int check;
|
||||
|
||||
check = 0;
|
||||
i = 0;
|
||||
while (str[i] != '\0')
|
||||
i = -1;
|
||||
while (str[++i] != '\0')
|
||||
{
|
||||
while (str[i] == ' ')
|
||||
i++;
|
||||
while (ft_is_in_quote(str, i))
|
||||
while (str[i] == ' ' || ft_is_in_quote(str, i))
|
||||
i++;
|
||||
if (str[i] == '\0')
|
||||
break ;
|
||||
@ -44,20 +42,13 @@ static int ft_pipe_is_alone(const char *str)
|
||||
else
|
||||
{
|
||||
if (check == 0)
|
||||
{
|
||||
ft_eprintf("minishell: Pipe must be followed and ");
|
||||
ft_eprintf("preced by a command or redirection\n");
|
||||
return (1);
|
||||
}
|
||||
break ;
|
||||
check = 0;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if (check == 0)
|
||||
{
|
||||
ft_eprintf("minishell: Pipe must be followed and ");
|
||||
ft_eprintf("preced by a command or redirection\n");
|
||||
}
|
||||
ft_eprintf("minishell: Pipe must be followed and ",
|
||||
"preced by a command or redirection\n");
|
||||
return (check == 0);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user