From 7229dc5996a25adfcba6d25f89ac855898e27b66 Mon Sep 17 00:00:00 2001 From: narnaud Date: Fri, 6 May 2022 23:24:18 +0200 Subject: [PATCH] fix redirs --- lexer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lexer.c b/lexer.c index 474a6c8..93be36a 100755 --- a/lexer.c +++ b/lexer.c @@ -41,7 +41,7 @@ int create_token(t_lexer *lex, char str[]) int set_redir(t_lexer *lex, char **line, char ch) { - static t_type type_out[2] = {ADD, OUT}; + static t_type type_out[2] = {OUT, ADD}; static t_type type_in[2] = {IN, HD}; t_type *type; @@ -52,9 +52,9 @@ int set_redir(t_lexer *lex, char **line, char ch) if (**line == ch && (*line)++) { if (**line == ch && (*line)++) - lex->next_type = type[0]; - else lex->next_type = type[1]; + else + lex->next_type = type[0]; return (1); } return (0);