-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexec_utils.c
More file actions
42 lines (37 loc) · 1.29 KB
/
exec_utils.c
File metadata and controls
42 lines (37 loc) · 1.29 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* exec_utils.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adurusoy <adurusoy@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/12/20 22:13:30 by adurusoy #+# #+# */
/* Updated: 2023/12/22 12:06:57 by adurusoy ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
t_parse *get_next_cmd(t_parse **parse)
{
t_parse *tmp;
tmp = *parse;
while (tmp->infile > STDERR || tmp->outfile > STDERR
|| tmp->type == HEREDOC)
{
tmp = tmp->next;
}
return (tmp->next);
}
int single_or_multi_command(t_shell *m_shell)
{
t_parse *parse;
int i;
i = 0;
parse = m_shell->parse;
while (parse)
{
if (parse->type == 2)
i++;
parse = parse->next;
}
return (i);
}