diff options
| author | Christopher Uhlig | 2025-01-23 18:41:18 +0100 |
|---|---|---|
| committer | Christopher Uhlig | 2025-01-23 18:41:18 +0100 |
| commit | 18fb7cb8ae69fc3439266a154aa6b0f947d6805d (patch) | |
| tree | 2cbdd7ab727d82cb69ea7acc431e2ffcc317e4ff /src/praise_the_norme.c | |
| parent | 202a5a26d1c0411c441cf12be2b22318abc4f3f9 (diff) | |
| download | minishell-18fb7cb8ae69fc3439266a154aa6b0f947d6805d.tar.gz minishell-18fb7cb8ae69fc3439266a154aa6b0f947d6805d.zip | |
a
Diffstat (limited to 'src/praise_the_norme.c')
| -rw-r--r-- | src/praise_the_norme.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/praise_the_norme.c b/src/praise_the_norme.c index 6af28c3..5639b7d 100644 --- a/src/praise_the_norme.c +++ b/src/praise_the_norme.c @@ -3,10 +3,10 @@ /* ::: :::::::: */ /* praise_the_norme.c :+: :+: :+: */ /* +:+ +:+ +:+ */ -/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */ +/* By: chuhlig <chuhlig@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/01/20 18:35:41 by dkaiser #+# #+# */ -/* Updated: 2025/01/22 17:30:02 by dkaiser ### ########.fr */ +/* Updated: 2025/01/23 18:31:49 by chuhlig ### ########.fr */ /* */ /* ************************************************************************** */ @@ -16,15 +16,19 @@ void i_love_the_norme(t_token **cur, t_token **tokens) { t_token *next_token; - next_token = (*cur)->next; - free_token_and_connect2(*cur); - if (next_token) + next_token = (*cur)->next;//setting next token to the adress of the next token + free_token_and_connect(*cur);// do i neee a double call here + //but technically it would remove the redir token + if (next_token)// if after redir is stuff { - if (next_token->previous == NULL) - *tokens = next_token->next; + if (next_token->previous == NULL)// then if is the first token or token after pipe + *tokens = next_token->next;// how does here come no error + //anyways i twould the redir adress token to the next token *cur = next_token->next; - free_token_and_connect2(next_token); + free_token_and_connect(next_token); } - else + else // else makes sense *cur = NULL; } + +// takes adress of token head or pos after pipe and the token specifer
\ No newline at end of file |
