-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate_parser_state.c
More file actions
31 lines (29 loc) · 1.26 KB
/
update_parser_state.c
File metadata and controls
31 lines (29 loc) · 1.26 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* update_parser_state.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: almelo <almelo@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/29 16:45:42 by almelo #+# #+# */
/* Updated: 2023/03/29 23:04:34 by almelo ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
void update_parser_state(char *content, size_t i, t_parser_state *state)
{
if (content[i] == content[0])
{
if (state->prevent_default == FALSE)
state->prevent_default = TRUE;
else
state->prevent_default = FALSE;
}
if (content[i] == '\'')
{
if (state->prevent_expand == FALSE)
state->prevent_expand = TRUE;
else
state->prevent_expand = FALSE;
}
}