aboutsummaryrefslogtreecommitdiff
path: root/src/tokenizer.c
diff options
context:
space:
mode:
authorChristopher Uhlig2024-08-09 13:00:47 +0200
committerChristopher Uhlig2024-08-09 13:00:47 +0200
commit665e9eb6fe20730b2f98cbc0f6617985204accc7 (patch)
tree45c3ecd97beb18d5abac5084b69d2c3843935df0 /src/tokenizer.c
parent4bcb095085729d9681f58ae110a3b550e4c697eb (diff)
downloadminishell-665e9eb6fe20730b2f98cbc0f6617985204accc7.tar.gz
minishell-665e9eb6fe20730b2f98cbc0f6617985204accc7.zip
test version with a bunch of fixes
Diffstat (limited to 'src/tokenizer.c')
-rw-r--r--src/tokenizer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tokenizer.c b/src/tokenizer.c
index f8ab9c4..672b6dc 100644
--- a/src/tokenizer.c
+++ b/src/tokenizer.c
@@ -6,7 +6,7 @@
/* By: chuhlig <chuhlig@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/06/28 20:55:50 by chuhlig #+# #+# */
-/* Updated: 2024/08/09 12:37:08 by chuhlig ### ########.fr */
+/* Updated: 2024/08/09 12:59:03 by chuhlig ### ########.fr */
/* */
/* ************************************************************************** */
@@ -78,7 +78,7 @@ void handle_special_chars(char *s, int *i, int *start, t_token **token_list)
else if (s[*i] == '\n')
*token_list = new_token(NEWLINE_TOKEN, *token_list, NULL);
print_token(*token_list);
- if (s[*i] == '<' || s[*i] == '>')
+ if (s[*i + 1] == '<' || s[*i + 1] == '>')
(*i)++;
*start = *i + 1;
}
@@ -95,7 +95,7 @@ void tokenizer(char *s, t_token **token_list)
f = 0;
while (s[++i])
{
- if (!f && ft_strchr("|<>\\n", s[i]))
+ if (!f && ft_strchr("|<>\n", s[i]))
handle_special_chars(s, &i, &pos, token_list);
else if (f && s[i] == quote_check)
f = 0;