From 25d81d04e20b4fe3ee3eece85563301f1818f5b3 Mon Sep 17 00:00:00 2001 From: tom moron Date: Thu, 29 Feb 2024 15:33:31 +0100 Subject: [PATCH] 61 tests --- srcs/parsing_var.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/srcs/parsing_var.c b/srcs/parsing_var.c index 395c0cc..f184a75 100755 --- a/srcs/parsing_var.c +++ b/srcs/parsing_var.c @@ -6,7 +6,7 @@ /* By: marde-vr +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/02/09 15:24:36 by tomoron #+# #+# */ -/* Updated: 2024/02/18 12:41:23 by tomoron ### ########.fr */ +/* Updated: 2024/02/29 15:31:25 by tomoron ### ########.fr */ /* */ /* ************************************************************************** */ @@ -28,6 +28,8 @@ int get_var_len(char **command, t_env *env) char *env_var; (*command)++; + if(**command == '\'' || **command == '"') + return(1); if (!ft_isalnum(**command) && **command != '_' && **command != '?') return (2); if (**command == '?') @@ -93,6 +95,12 @@ int add_var_to_str(char *res, char **command, t_env *env) int i; i = 0; + if(**command == '\'' || **command == '"') + { + *res = '$'; + (*command)--; + return(1); + } if (!ft_isalnum(**command) && **command != '_' && **command != '?') { res[0] = '$';