-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsniper.c
43 lines (40 loc) · 1.45 KB
/
sniper.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
33
34
35
36
37
38
39
40
41
42
43
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* sniper.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adel-cor <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/04/05 13:30:14 by adel-cor #+# #+# */
/* Updated: 2022/04/12 10:40:37 by adel-cor ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
void printest(struct s_tnode *tnode)
{
while (tnode)
{
tnode->type = STRING;
tnode = tnode->next;
}
}
void test(struct s_tnode *tnode)
{
while (tnode)
{
if (!tnode->q_type)
{
if (tnode->str[0] == '|')
tnode->type = PIPE;
else if (tnode->str[0] == '<' && tnode->str[1] == '<')
tnode->type = HEREDOC_L;
else if (tnode->str[0] == '<')
tnode->type = REDIR_L;
else if (tnode->str[0] == '>' && tnode->str[1] == '>')
tnode->type = APPEND;
else if (tnode->str[0] == '>')
tnode->type = REDIR_R;
}
tnode = tnode->next;
}
}