summaryrefslogtreecommitdiffstats
path: root/src/ft_p_lcom.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-04-22 22:54:14 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-04-22 22:54:14 +0200
commit91b822851212a43feca13a7f540c451074132c3d (patch)
tree22b11850fd656b0fbc08cfde206bd377773e1b67 /src/ft_p_lcom.c
parentStarting to do redirections (diff)
download42-minishell-91b822851212a43feca13a7f540c451074132c3d.tar.gz
42-minishell-91b822851212a43feca13a7f540c451074132c3d.tar.bz2
42-minishell-91b822851212a43feca13a7f540c451074132c3d.tar.xz
42-minishell-91b822851212a43feca13a7f540c451074132c3d.tar.zst
42-minishell-91b822851212a43feca13a7f540c451074132c3d.zip
Implementing redirections
Diffstat (limited to '')
-rw-r--r--src/ft_p_lcom.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/ft_p_lcom.c b/src/ft_p_lcom.c
index 15247a2..ec30f43 100644
--- a/src/ft_p_lcom.c
+++ b/src/ft_p_lcom.c
@@ -15,6 +15,34 @@
#include "ft_s_lcom.h"
#include "ft_s_struct.h"
+void
+ ft_check_redir_file()
+{
+}
+
+void
+ ft_get_redir(const char word[],
+ t_lcom **link)
+{
+ char *ptr;
+
+ ptr = word;
+ while (*ptr)
+ {
+ if (*ptr == '<')
+ {
+ *link->redir = -1;
+ break ;
+ }
+ if (*ptr == '>')
+ {
+ *link->redir = (*(ptr + 1) == '>') ? (2) : (1);
+ break ;
+ }
+ ptr++;
+ }
+}
+
int8_t
ft_p_lcom(const char line[],
const uint64_t count,