fix: fixed multiple syntax error logging when redirection value is not a word
pointer is moved to the last position to avoid double logging
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
/* By: sede-san <sede-san@student.42madrid.com +#+ +:+ +#+ */
|
/* By: sede-san <sede-san@student.42madrid.com +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/10/22 18:37:38 by sede-san #+# #+# */
|
/* Created: 2025/10/22 18:37:38 by sede-san #+# #+# */
|
||||||
/* Updated: 2026/02/11 02:42:52 by sede-san ### ########.fr */
|
/* Updated: 2026/02/11 10:08:22 by sede-san ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@@ -154,6 +154,8 @@ t_redirection *redirection_new(
|
|||||||
if (token->type != TOKEN_WORD)
|
if (token->type != TOKEN_WORD)
|
||||||
{
|
{
|
||||||
free(redirection);
|
free(redirection);
|
||||||
|
while (*tokens != NULL)
|
||||||
|
*tokens = (*tokens)->next;
|
||||||
return (syntax_error_unexpected_token(token), NULL);
|
return (syntax_error_unexpected_token(token), NULL);
|
||||||
}
|
}
|
||||||
redirection->target = ft_strdup(token->value);
|
redirection->target = ft_strdup(token->value);
|
||||||
|
|||||||
Reference in New Issue
Block a user