From 91b822851212a43feca13a7f540c451074132c3d Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Wed, 22 Apr 2020 22:54:14 +0200 Subject: Implementing redirections --- src/ft_p_lcom.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/ft_p_lcom.c') 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, -- cgit v1.2.3