-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnorm.c
More file actions
55 lines (49 loc) · 1.4 KB
/
norm.c
File metadata and controls
55 lines (49 loc) · 1.4 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* norm.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mmokane <mmokane@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/07/27 04:06:55 by mmokane #+# #+# */
/* Updated: 2023/08/03 18:04:32 by mmokane ### ########.fr */
/* */
/* ************************************************************************** */
#include "includes/minishell.h"
void ac_check(int ac)
{
g_exit_status = 0;
if (ac != 1)
{
write(2, "minishell : ", 13);
write(2, "no such file or directory\n", 27);
exit(1);
}
}
void check_exit(char *input)
{
if (!input)
{
ft_putstr_fd("exit", 2);
exit(1);
}
}
int spaces_check(char *input)
{
int i;
i = 0;
while (input[i])
{
if ((input[i] != ' ' || input[i] != '\n' || input[i] != '\t'))
return (0);
i++;
}
return (1);
}
void check_check_spaces(char *input)
{
if (spaces_check(input))
{
free(input);
}
}