forked from chozeur/minishell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexpand_loop.c
32 lines (29 loc) · 1.28 KB
/
expand_loop.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* expand_loop.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: flcarval <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/27 14:32:39 by tbrebion #+# #+# */
/* Updated: 2022/07/30 07:51:00 by flcarval ### ########.fr */
/* */
/* ************************************************************************** */
#include "../../include/minishell.h"
void expand_loop(void)
{
int i;
t_list *lst;
i = 0;
lst = *g_data.tokens;
while (lst)
{
if (lst && get_n_lst(g_data.tokens, i - 1) \
&& get_n_lst(g_data.tokens, i - 1)->content->type != I_D_INREDIR \
&& (lst->content->type == I_LITERAL \
|| lst->content->type == I_D_QUOTE))
lst->content->val = expand_str(lst->content->val);
lst = lst->next;
i++;
}
}