-
Notifications
You must be signed in to change notification settings - Fork 0
/
quotes2.c
41 lines (36 loc) · 1.4 KB
/
quotes2.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* quotes2.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: zwalad <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/08/03 19:02:19 by zwalad #+# #+# */
/* Updated: 2022/08/19 14:33:04 by zwalad ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
t_list *l_quotes(t_list *p)
{
char c;
c = p->line[p->i];
p->i++;
while (p->line[p->i] != c && p->line[p->i])
p->m->val[p->m->j] = put_char(p->m->val[p->m->j], p->line[p->i++]);
if (p->line[p->i] == c)
p->i++;
return (p);
}
t_list *qts_help(t_list *p)
{
char c;
c = p->line[p->i];
p->i++;
p->m->val[p->m->j] = pr_strdup("");
while (p->line[p->i] != c && p->line[p->i])
p->m->val[p->m->j] = put_char(p->m->val[p->m->j], p->line[p->i++]);
p->m->j++;
if (p->line[p->i] == c)
p->i++;
return (p);
}