aboutsummaryrefslogtreecommitdiff
path: root/src/new_token.c
diff options
context:
space:
mode:
authorChristopher Uhlig2025-01-25 13:01:10 +0100
committerChristopher Uhlig2025-01-25 13:01:10 +0100
commit87b90103930d83d74baa998866b0995cb8887d51 (patch)
tree0eb876341c2794f2165b83c1d339fb3b38e9f711 /src/new_token.c
parent18fb7cb8ae69fc3439266a154aa6b0f947d6805d (diff)
downloadminishell-87b90103930d83d74baa998866b0995cb8887d51.tar.gz
minishell-87b90103930d83d74baa998866b0995cb8887d51.zip
fixed leaks in tokenizer and collectargs also fixed seg for < > and improved value add by $ use
Diffstat (limited to 'src/new_token.c')
-rw-r--r--src/new_token.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/new_token.c b/src/new_token.c
index 6f49681..c9bd28c 100644
--- a/src/new_token.c
+++ b/src/new_token.c
@@ -6,11 +6,12 @@
/* By: chuhlig <chuhlig@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/06/27 14:29:44 by dkaiser #+# #+# */
-/* Updated: 2025/01/22 00:41:47 by chuhlig ### ########.fr */
+/* Updated: 2025/01/24 18:46:05 by chuhlig ### ########.fr */
/* */
/* ************************************************************************** */
#include "token.h"
+#include "libft.h"
t_token *new_token(int type, t_token *previous, t_token *next)
{
@@ -39,7 +40,7 @@ t_token *new_str_token(char *str, t_token *previous, t_token *next)
free(str);
return (NULL);
}
- token->content.string = str;
+ token->content.string = ft_strdup(str);
return (token);
}