mirror of
https://github.com/KeyZox71/ft_minipowershell.git
synced 2025-03-15 03:16:51 +01:00
「🔨」 fix: when infile not here
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
/* By: mmoussou <mmoussou@student.42angoulem +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/11/08 21:44:04 by mmoussou #+# #+# */
|
||||
/* Updated: 2024/08/01 17:49:16 by adjoly ### ########.fr */
|
||||
/* Updated: 2024/08/01 19:56:12 by adjoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -21,7 +21,6 @@ void ft_lstclear(t_list **lst, void (*del)(void *))
|
||||
while (lst && *lst && del)
|
||||
{
|
||||
tmp = (*lst)->next;
|
||||
if ((*lst)->content)
|
||||
ft_lstdelone(*lst, del);
|
||||
*lst = tmp;
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: mmoussou <mmoussou@student.42angoulem +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/11/08 20:40:46 by mmoussou #+# #+# */
|
||||
/* Updated: 2023/11/13 19:32:04 by mmoussou ### ########.fr */
|
||||
/* Updated: 2024/08/01 19:56:26 by adjoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -16,6 +16,7 @@ void ft_lstdelone(t_list *lst, void (*del)(void *))
|
||||
{
|
||||
if (!lst || !del)
|
||||
return ;
|
||||
if (lst->content)
|
||||
del(lst->content);
|
||||
free(lst);
|
||||
lst = NULL;
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/05/31 12:47:13 by adjoly #+# #+# */
|
||||
/* Updated: 2024/08/01 18:07:13 by adjoly ### ########.fr */
|
||||
/* Updated: 2024/08/01 19:07:28 by adjoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -41,7 +41,8 @@ t_list *get_cmd_list(t_list *list)
|
||||
tmp = tmp->next;
|
||||
while (tmp)
|
||||
{
|
||||
ft_lstadd_back(&cmd_list, make_lst(tmp));
|
||||
ft_lstadd_back(&cmd_list, ft_lstnew(get_redir_fd(tmp->content, \
|
||||
((t_token *)tmp->content)->redirection)));
|
||||
if (!ft_lstlast(cmd_list)->content)
|
||||
{
|
||||
ft_lstclear(&cmd_list, &free_cmd);
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/07/04 20:10:35 by adjoly #+# #+# */
|
||||
/* Updated: 2024/08/01 17:40:10 by adjoly ### ########.fr */
|
||||
/* Updated: 2024/08/01 19:15:44 by adjoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -27,8 +27,11 @@ void free_token(void *token_v)
|
||||
t_token *token;
|
||||
|
||||
token = token_v;
|
||||
if (token->argv)
|
||||
free(token->argv);
|
||||
if (token->redirection)
|
||||
ft_lstclear(&(token->redirection), free_redir);
|
||||
if (token)
|
||||
free(token);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user