/* By: chuhlig <chuhlig@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/02 13:49:31 by dkaiser #+# #+# */
-/* Updated: 2025/01/25 11:40:52 by chuhlig ### ########.fr */
+/* Updated: 2025/01/25 14:37:06 by dkaiser ### ########.fr */
/* */
/* ************************************************************************** */
char *str;
if ((*cur)->content.redir_type != INPUT_LIMITER)
- str = ft_strdup((*cur)->next->content.string);
+ str = (*cur)->next->content.string;
if ((*cur)->content.redir_type == INPUT_LIMITER)
{
if (!set_heredoc_data(*cur, result, data->env))
q4fc(data->create_files, set_redir(&result[1], OUTPUT_APPEND,
format_string(str, data->env, 0), data->env));
i_love_the_norme(cur, tokens);
+ free(str);
}
static t_redirection *set_redir(t_redirection *redir, int type, char *spec,
/* By: chuhlig <chuhlig@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/12/17 19:21:35 by chuhlig #+# #+# */
-/* Updated: 2025/01/25 11:41:42 by chuhlig ### ########.fr */
+/* Updated: 2025/01/25 14:42:39 by dkaiser ### ########.fr */
/* */
/* ************************************************************************** */
int original_std[2];
int result;
+ if (cmd->args == NULL || cmd->args[0] == NULL)
+ return (EXIT_FAILURE);
original_std[1] = dup(STDOUT_FILENO);
original_std[0] = dup(STDIN_FILENO);
create_files(cmd->create_files);