quote done
This commit is contained in:
@@ -20,19 +20,6 @@ int is_meta(char c)
|
||||
return (0);
|
||||
}
|
||||
|
||||
int ft_str_count(char *s, char c)
|
||||
{
|
||||
int i;
|
||||
int count;
|
||||
|
||||
i = -1;
|
||||
count = 0;
|
||||
while (s[++i])
|
||||
if (s[i] == c)
|
||||
count++;
|
||||
return (count);
|
||||
}
|
||||
|
||||
int trim_nodes(t_node *head)
|
||||
{
|
||||
t_node *it;
|
||||
@@ -43,19 +30,9 @@ int trim_nodes(t_node *head)
|
||||
in_quote = 0;
|
||||
while (it != NULL)
|
||||
{
|
||||
if (ft_str_count(it->val, 39) == 1 || ft_str_count(it->val, '"') == 1)
|
||||
{
|
||||
if (!in_quote)
|
||||
in_quote = it->val[0];
|
||||
else if (it->val[0] == in_quote)
|
||||
in_quote = 0;
|
||||
}
|
||||
if (!in_quote)
|
||||
{
|
||||
tmp = ft_strtrim(it->val, " \t\n");
|
||||
free(it->val);
|
||||
it->val = tmp;
|
||||
}
|
||||
tmp = ft_strtrim(it->val, " \t\n");
|
||||
free(it->val);
|
||||
it->val = tmp;
|
||||
it = it->next;
|
||||
}
|
||||
return (1);
|
||||
|
||||
Reference in New Issue
Block a user