🏗️」 wip: Testing pipe check

This commit is contained in:
2024-07-29 20:46:17 +02:00
parent c3aad1290d
commit 59c03e8e42
12 changed files with 369 additions and 10 deletions

View File

@ -6,7 +6,7 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/06/30 12:52:22 by adjoly #+# #+# */
/* Updated: 2024/07/18 17:04:06 by adjoly ### ########.fr */
/* Updated: 2024/07/29 20:41:05 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
@ -14,6 +14,7 @@
#include "parsing.h"
#include <stdbool.h>
#include "error_msg.h"
#include <stdio.h>
size_t strlen_till_end_char(char *s, int c)
{
@ -34,7 +35,10 @@ bool check_pipe(char *readline)
{
if (*tmp == '|' && is_inquote(readline, tmp - readline) == FALSE)
{
tmp += strlen_till_end_char(tmp + 1, ' ') + 1;
if (!*tmp)
return (send_error_parsing("No command after pipe"));
while (*tmp && !ft_isspace(*tmp))
tmp++;
if (!*tmp)
return (send_error_parsing("No command after pipe"));
}