-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.c
47 lines (42 loc) · 1.39 KB
/
init.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
44
45
46
47
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* init.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: kyhan <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/09/13 20:13:42 by kyhan #+# #+# */
/* Updated: 2022/09/13 20:13:43 by kyhan ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
extern char **environ;
void init_info(t_info *info)
{
info->double_quote_flag = 0;
info->quote_flag = 0;
info->redir_out_flag = 0;
info->redir_in_flag = 0;
info->redir_cnt = 0;
info->tmp_fd = 0;
info->hd_cnt = 0;
info->dlist = 0;
info->fo.i = 0;
info->fo.last_idx = 0;
info->root = 0;
info->err_flag = 0;
info->path_flag = 0;
}
int init_env(t_info *info)
{
int i;
i = 0;
info->env = 0;
while (environ[i])
{
add_list(&info->env, environ[i]);
i++;
}
rl_catch_signals = 0;
return (0);
}