mirror of
https://github.com/KeyZox71/ft_minipowershell.git
synced 2025-05-11 06:58:47 +02:00
「🏗️」 wip: Testing pipe check
This commit is contained in:
@ -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"));
|
||||
}
|
||||
|
Reference in New Issue
Block a user