mirror of
https://github.com/KeyZox71/ft_minipowershell.git
synced 2025-05-10 22:58:45 +02:00
「✨」 feat: Added ctrl c to heredoc
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/05/31 12:47:13 by adjoly #+# #+# */
|
||||
/* Updated: 2024/07/10 01:12:52 by adjoly ### ########.fr */
|
||||
/* Updated: 2024/07/13 14:08:31 by adjoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -14,20 +14,40 @@
|
||||
#include "parsing.h"
|
||||
#include "minishell.h"
|
||||
|
||||
t_list *make_lst(t_list *tmp)
|
||||
{
|
||||
t_list *cmd_list;
|
||||
|
||||
cmd_list = malloc(sizeof(t_list));
|
||||
get_list2(&cmd_list);
|
||||
cmd_list->next = NULL;
|
||||
cmd_list->content = get_redir_fd(tmp->content);
|
||||
return (cmd_list);
|
||||
}
|
||||
|
||||
t_list *get_cmd_list(t_list *list)
|
||||
{
|
||||
t_list *tmp;
|
||||
t_list *cmd_list;
|
||||
|
||||
tmp = list;
|
||||
cmd_list = malloc(sizeof(t_list));
|
||||
get_list2(&cmd_list);
|
||||
cmd_list->next = NULL;
|
||||
cmd_list->content = get_redir_fd(tmp->content);
|
||||
cmd_list = make_lst(tmp);
|
||||
if (!cmd_list->content)
|
||||
{
|
||||
free(cmd_list);
|
||||
return (NULL);
|
||||
}
|
||||
tmp = tmp->next;
|
||||
while (tmp)
|
||||
{
|
||||
ft_lstadd_back(&cmd_list, ft_lstnew(get_redir_fd(tmp->content)));
|
||||
if (!ft_lstlast(cmd_list)->content)
|
||||
{
|
||||
ft_lstclear(&cmd_list, &free_cmd);
|
||||
if (cmd_list)
|
||||
free(cmd_list);
|
||||
return (NULL);
|
||||
}
|
||||
tmp = tmp->next;
|
||||
}
|
||||
return (cmd_list);
|
||||
|
Reference in New Issue
Block a user