-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathheredoc_errors.c
29 lines (27 loc) · 1.2 KB
/
heredoc_errors.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* heredoc_errors.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cdomet-d <cdomet-d@student.42lyon.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/16 16:14:03 by cdomet-d #+# #+# */
/* Updated: 2024/05/24 12:03:51 by cdomet-d ### ########lyon.fr */
/* */
/* ************************************************************************** */
#include "exec.h"
void *heredoc_error(t_input *in, char *tmpdel, char *line, bool err)
{
if (in->data[0][0] < 0)
in->data[0][0] *= -1;
if (err)
{
if (errno == ENOMEM)
print_error(errno, "minishell");
verror \
("minishell: ", "warning: expected delimiter: ", in->data[0]);
}
free(tmpdel);
free(line);
return (NULL);
}