fix is_var

This commit is contained in:
tom moron
2024-05-08 11:57:49 +02:00
parent e986d8692b
commit d1681dafe3
3 changed files with 7 additions and 7 deletions

View File

@ -6,7 +6,7 @@
/* By: tomoron <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/06 10:57:33 by tomoron #+# #+# */
/* Updated: 2024/05/06 10:57:39 by tomoron ### ########.fr */
/* Updated: 2024/05/08 11:54:17 by tomoron ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
@ -47,7 +47,6 @@ char *expand_variables(char *command, t_env *env, int *is_var)
res = ft_calloc(get_variable_expantion_len(command, env) + 1, 1);
in_quote = 0;
in_dquote = 0;
*is_var = 1;
i = 0;
while (res && *command)
{
@ -56,7 +55,7 @@ char *expand_variables(char *command, t_env *env, int *is_var)
if (*command == '"' && !in_quote)
in_dquote = !in_dquote;
if (*command == '$' && !in_quote)
i += add_var_to_str(res + i, &command, env, in_dquote);
i += add_var_to_str(res + i, &command, env, in_dquote, is_var);
else
res[i++] = *command;
command++;