From: Lukas Jiriste Date: Thu, 1 Aug 2024 13:40:26 +0000 (+0200) Subject: Make operators < and << work X-Git-Url: https://git.ljiriste.work/?a=commitdiff_plain;h=f561c16753dcf7649b222c9b2e0fe6ca2445b6b9;p=42%2Fminishell.git Make operators < and << work There was a minor confusion when the redirection was first implemented because the usage was not yet thought about much. --- diff --git a/src/execution.c b/src/execution.c index f1f2231..c0b835c 100644 --- a/src/execution.c +++ b/src/execution.c @@ -6,7 +6,7 @@ /* By: ljiriste +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/07/21 08:57:54 by ljiriste #+# #+# */ -/* Updated: 2024/08/01 15:16:57 by ljiriste ### ########.fr */ +/* Updated: 2024/08/01 15:30:29 by ljiriste ### ########.fr */ /* */ /* ************************************************************************** */ @@ -143,7 +143,7 @@ int add_redirection_file(t_vec *redirections, t_parse_tree_node *io_file, int fd free(filename); return (1); } - redir = (t_redirection){.from_to_fds[0] = sec_fd, .from_to_fds[1] = fd, .created = 0}; + redir = (t_redirection){.from_to_fds[0] = fd, .from_to_fds[1] = sec_fd, .created = 0}; } else { @@ -321,7 +321,7 @@ int add_redirection_here(t_vec *redirections, t_parse_tree_node *io_here, int fd free(delimiter); if (err) return (1); - redir = (t_redirection){.from_to_fds[0] = pipe_fds[0], .from_to_fds[1] = fd, .created = 1}; + redir = (t_redirection){.from_to_fds[0] = fd, .from_to_fds[1] = pipe_fds[0], .created = 1}; return (ft_vec_append(redirections, &redir) != success); }