diff --git a/src/postprocess/redirections/redirection_parsing.c b/src/postprocess/redirections/redirection_parsing.c index 78962e4..e7a8fbb 100644 --- a/src/postprocess/redirections/redirection_parsing.c +++ b/src/postprocess/redirections/redirection_parsing.c @@ -6,7 +6,7 @@ /* By: khais +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/03/07 12:30:04 by khais #+# #+# */ -/* Updated: 2025/03/11 14:58:11 by khais ### ########.fr */ +/* Updated: 2025/03/19 18:28:28 by khais ### ########.fr */ /* */ /* ************************************************************************** */ @@ -78,9 +78,12 @@ struct s_simple_cmd *parse_redirections(struct s_simple_cmd *cmd) { type = redir_type_from_worddesc(wordlist_get(cmd->words, i)); if (type != REDIR_INVALID) + { if (redirection_found(cmd, i, type) == NULL) return (NULL); - i++; + } + else + i++; } return (cmd); } diff --git a/test.sh b/test.sh index 9957795..8bbbcbb 100755 --- a/test.sh +++ b/test.sh @@ -102,6 +102,29 @@ expecting <outfile +EOF +expecting < out EOF @@ -119,8 +142,51 @@ expecting <outfile there < infile < infile2 >> append +EOF +expecting <