diff options
Diffstat (limited to 'src/p_lblock.c')
-rw-r--r-- | src/p_lblock.c | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/src/p_lblock.c b/src/p_lblock.c index 3acae1a..ba47028 100644 --- a/src/p_lblock.c +++ b/src/p_lblock.c @@ -83,36 +83,14 @@ static void } } -int8_t - p_get_redir(const char word[], t_com **com) +int8_t p_get_redirs(const char word[], t_com **com) { char *ptr; ptr = (char *)word; - while (*ptr) + while (*ptr != C_NUL) { - if (*ptr == '<') - { - (*com)->redir = -1; - break ; - } - if (*ptr == '>') - { - (*com)->redir = (*(ptr + 1) == '>') ? (2) : (1); - break ; - } ptr++; - /* gl hf */ - } - if ((*com)->redir > 0) - { - if (ft_isdigit(*(ptr - 1)) == TRUE) - get_rdrfd(ptr - 1, com); - else - (*com)->rdrfd = STDOUT_FILENO; - rdr_err_check(ptr, com); - if (get_rdrpath(ptr, com) != 0) - return (-1); } return (0); } |