-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathliner.c
38 lines (34 loc) · 1.42 KB
/
liner.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* liner.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jaesjeon <jaesjeon@student.42seoul.kr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/08/23 08:10:39 by minsuki2 #+# #+# */
/* Updated: 2022/09/20 03:57:47 by jaesjeon ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell_info.h"
#include "minishell.h"
#include "ft_token.h"
#include "ft_string.h"
static int _check_line_oflag(char *line, int *parentheses_flag, \
int *quote_flag)
{
while (*line)
{
set_quote_flag(*line, quote_flag);
set_parentheses_flag(*line, parentheses_flag, quote_flag);
line++;
}
return (*parentheses_flag || *quote_flag);
}
char *liner(t_oflag *oflag)
{
char *line;
ft_memset(oflag, 0, sizeof(t_oflag));
line = my_readline("SUNSH$> ");
_check_line_oflag(line, &oflag->parentheses, &oflag->quote);
return (line);
}