From 843bdc0061a499ff0d071d3a06971bfb5c556748 Mon Sep 17 00:00:00 2001 From: Sergio Date: Thu, 12 Feb 2026 02:57:15 +0100 Subject: [PATCH] fix: invalid syntax error cause shown when there was no token following a redirection --- src/errors/errors.c | 5 +++-- src/parser/parser.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/errors/errors.c b/src/errors/errors.c index ebc71f1..b8d8238 100644 --- a/src/errors/errors.c +++ b/src/errors/errors.c @@ -6,7 +6,7 @@ /* By: sede-san value; if (token == NULL) cause = "newline"; + else + cause = token->value; ft_eprintf("minishell: syntax error near unexpected token `%s'\n", cause); } diff --git a/src/parser/parser.c b/src/parser/parser.c index 81a3082..3394b6a 100644 --- a/src/parser/parser.c +++ b/src/parser/parser.c @@ -6,7 +6,7 @@ /* By: sede-san content; if (token->type != TOKEN_WORD)