merging conflicts

This commit is contained in:
Hugo LAMY
2021-12-20 15:07:58 +01:00
parent 59a43ea1cc
commit 0a64977cdc
8 changed files with 43 additions and 35 deletions

View File

@@ -6,7 +6,7 @@
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/11/07 02:01:33 by lperrey #+# #+# */
/* Updated: 2021/12/16 03:03:27 by lperrey ### ########.fr */
/* Updated: 2021/12/20 14:47:04 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */
@@ -35,7 +35,7 @@ t_list *expand_token(char *content)
expand->next = content_copy(content, &i, &quotes_state);
expand = expand->next;
if (!expand)
{//todo wrap
{
perror("expand_token() error");
return (ft_lstclear(&head.next, free));
}
@@ -88,7 +88,7 @@ static char *env_var_expansion(char *content, int *i)
{
char *expansion;
(*i)++; // skip '$'
(*i)++;
if (content[*i] == '?')
{
(*i)++;
@@ -112,7 +112,7 @@ static char *retrieve_var(char *content, int *i)
char *tmp;
int i_exp;
expansion = ft_calloc(ft_strlen(&content[*i - 1]) + 1, 1); // *i - 1 for '$' skip
expansion = ft_calloc(ft_strlen(&content[*i - 1]) + 1, 1);
if (!expansion)
return (NULL);
i_exp = 0;

View File

@@ -6,7 +6,7 @@
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/11/07 02:01:33 by lperrey #+# #+# */
/* Updated: 2021/12/10 19:11:52 by lperrey ### ########.fr */
/* Updated: 2021/12/20 14:56:05 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */
@@ -28,7 +28,7 @@ int new_token_for_each_field(char **fields, t_token *t)
insert_lst->next = ft_lstnew_generic(sizeof(t_token), 0);
insert_lst = insert_lst->next;
if (!insert_lst)
{//todo wrap
{
perror("insert_token_for_each_field() error");
ft_free_2d_arr(fields);
return ((int)ft_lstclear((t_list **)&head.next, NULL));
@@ -51,11 +51,8 @@ static void insert_tokens(t_token *t, t_token *insert_lst)
ft_free_null(&t->content);
if (!insert_lst)
return ;
tmp = t->next;
t->next = insert_lst;
insert_lst_last = (t_token *)ft_lstlast((t_list *)insert_lst);
insert_lst_last->next = tmp;
//return (insert_lst_last); // return inutile pour reusinage
}

View File

@@ -6,7 +6,7 @@
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/11/07 02:01:33 by lperrey #+# #+# */
/* Updated: 2021/11/07 04:03:02 by lperrey ### ########.fr */
/* Updated: 2021/12/20 14:55:03 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */
@@ -23,9 +23,9 @@ char *rejoin_after_expand(t_list *expand_lst)
{
result = ft_strjoinfree_s1(result, expand_lst->content);
if (!result)
{//todo wrap
{
perror("rejoin_after_expand() error");
return (ft_lstclear(&head, free));
return (ft_lstclear(&head, free));
}
expand_lst = expand_lst->next;
}