-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell_utils.c
33 lines (30 loc) · 1.21 KB
/
shell_utils.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* shell_utils.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: yufukuya <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/02/02 18:15:11 by yufukuya #+# #+# */
/* Updated: 2021/02/03 12:37:19 by yufukuya ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft/libft.h"
#include "minishell.h"
int isshellspecial(int c)
{
return (c == '<' || c == '>' ||
c == '&' || c == '|' || c == ';');
}
int isredir(char *str)
{
if (!str)
return (0);
if (ft_strcmp(str, ">") == 0)
return (1);
if (ft_strcmp(str, "<") == 0)
return (1);
if (ft_strcmp(str, ">>") == 0)
return (1);
return (0);
}