Files
mmoat/srcs/parsing/tokenizer/tokenizer_utils.c
gazhonsepaskwa 5826dfd43e quote done
2025-02-17 15:52:35 +01:00

40 lines
1.3 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* tokenizer_utils.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: nalebrun <nalebrun@student.s19.be> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/01/22 14:24:05 by nalebrun #+# #+# */
/* Updated: 2025/02/11 16:33:45 by nalebrun ### ########.fr */
/* */
/* ************************************************************************** */
#include "../../../includes/minishell.h"
int is_meta(char c)
{
if (c == '&' || c == '|' || c == '<' || c == '>' || c == '(' || c == ')'
|| c == ';' || c == '{' || c == '}' || c == '[' || c == ']')
return (1);
return (0);
}
int trim_nodes(t_node *head)
{
t_node *it;
char *tmp;
char in_quote;
it = head;
in_quote = 0;
while (it != NULL)
{
tmp = ft_strtrim(it->val, " \t\n");
free(it->val);
it->val = tmp;
it = it->next;
}
return (1);
}