From: Lukas Jiriste Date: Mon, 22 Jul 2024 18:44:27 +0000 (+0200) Subject: Fix the get_var_name name recognition logic X-Git-Url: https://git.ljiriste.work/?a=commitdiff_plain;h=d56a92bdec0b6525ddd5f2ab7c9d3c74e290b699;p=42%2Fminishell.git Fix the get_var_name name recognition logic --- diff --git a/src/execution.c b/src/execution.c index 259d652..04dea58 100644 --- a/src/execution.c +++ b/src/execution.c @@ -6,7 +6,7 @@ /* By: ljiriste +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/07/21 08:57:54 by ljiriste #+# #+# */ -/* Updated: 2024/07/22 00:09:18 by ljiriste ### ########.fr */ +/* Updated: 2024/07/22 20:42:30 by ljiriste ### ########.fr */ /* */ /* ************************************************************************** */ @@ -148,7 +148,7 @@ char *get_var_name(const char *line) size_t i; i = 0; - while (line[i] && !ft_isspace(line[i])) + while (ft_isalnum(line[i]) || line[i] == '_') ++i; return (ft_strndup(line, i)); }