🔨」 fix: fixed some things.

This commit is contained in:
2024-08-13 15:19:03 +02:00
parent 7116688ec5
commit 89391a38c5
5 changed files with 14 additions and 12 deletions

0
ok
View File

View File

@ -6,7 +6,7 @@
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/08 17:42:57 by mmoussou #+# #+# */
/* Updated: 2024/05/03 16:03:57 by mmoussou ### ########.fr */
/* Updated: 2024/08/13 15:07:07 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
@ -16,7 +16,7 @@ void ft_envadd_back(t_env **env, t_env *new)
{
t_env *tmp;
if (!env || !new)
if (!env)
return ;
if (!*env)
{

View File

@ -6,7 +6,7 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/07/09 16:32:21 by adjoly #+# #+# */
/* Updated: 2024/08/10 17:44:56 by adjoly ### ########.fr */
/* Updated: 2024/08/13 15:11:58 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */

View File

@ -6,7 +6,7 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/05 14:19:35 by adjoly #+# #+# */
/* Updated: 2024/08/13 13:40:20 by adjoly ### ########.fr */
/* Updated: 2024/08/13 15:06:13 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */

View File

@ -6,7 +6,7 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/18 20:13:50 by adjoly #+# #+# */
/* Updated: 2024/08/13 13:47:48 by adjoly ### ########.fr */
/* Updated: 2024/08/13 15:18:14 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
@ -28,6 +28,7 @@ t_list *tokenizer(char *readline, t_env *env)
t_list *cmd;
t_list *piped;
t_list *tmp;
t_cmd *ret;
(void)(env);
piped = __split_pipe(readline);
@ -37,17 +38,18 @@ t_list *tokenizer(char *readline, t_env *env)
get_list(&piped);
while (tmp)
{
ft_lstadd_back(&cmd,
ft_lstnew(__to_cmd(split_argv(env_var_replace(tmp->content,
env)))));
ret = __to_cmd(split_argv(env_var_replace(tmp->content, env)));
if (!ret)
return (clear_all(cmd, piped));
ft_lstadd_back(&cmd, ft_lstnew(ret));
if (!cmd)
return (clear_all(cmd, piped));
if (!ft_lstlast(cmd)->content)
return (clear_all(cmd, piped));
if (!cmd->next)
get_list2(&cmd);
if (((t_cmd *)ft_lstlast(cmd)->content)->infile == -2)
return (clear_all(cmd, piped));
//if (!ft_lstlast(cmd)->content)
//return (clear_all(cmd, piped));
if (!cmd->next)
get_list2(&cmd);
tmp = tmp->next;
}
ft_lstclear(&piped, free);