diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-03 19:00:47 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-03 19:00:47 +0200 |
commit | bfaf4c53a8406ea0bfbd8699807b567a5322a03f (patch) | |
tree | b8ce7d07b3094de0c4ba98160f35cf7e64eeae1d /src/u_vars.c | |
parent | Added $ for varname (diff) | |
download | 42-minishell-bfaf4c53a8406ea0bfbd8699807b567a5322a03f.tar.gz 42-minishell-bfaf4c53a8406ea0bfbd8699807b567a5322a03f.tar.bz2 42-minishell-bfaf4c53a8406ea0bfbd8699807b567a5322a03f.tar.xz 42-minishell-bfaf4c53a8406ea0bfbd8699807b567a5322a03f.tar.zst 42-minishell-bfaf4c53a8406ea0bfbd8699807b567a5322a03f.zip |
Export is working
Diffstat (limited to 'src/u_vars.c')
-rw-r--r-- | src/u_vars.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/u_vars.c b/src/u_vars.c index f7123ef..913b07b 100644 --- a/src/u_vars.c +++ b/src/u_vars.c @@ -21,7 +21,7 @@ #include "s_struct.h" static char - *set_rva(const char varname[], + *u_set_rva(const char varname[], t_msh *msh) { char *rvarname; @@ -32,7 +32,7 @@ static char s_destroy(msh); f_fail_alloc(msh); } - ft_memcpy((char*)rvarname, (const char*)varname + 1, + (void)ft_memcpy((char*)rvarname, (const char*)varname + 1, ft_strlen(varname + 1)); *(rvarname + ft_strlen(varname + 1)) = '='; *(rvarname + ft_strlen(varname + 1) + 1) = '\0'; @@ -40,7 +40,7 @@ static char } static char - *dup_env(char *p_env, + *u_dup_env(char *p_env, char *rvarname, t_msh *msh) { @@ -58,7 +58,7 @@ static char } static char - *get_frm_env(char rvarname[], + *u_get_frm_env(char rvarname[], t_msh *msh) { char **p_env; @@ -75,7 +75,7 @@ static char pp_env += 1; if (*pp_env == '=') pp_env += 1; - varval = dup_env(pp_env, rvarname, msh); + varval = u_dup_env(pp_env, rvarname, msh); return (varval); } p_env += 1; @@ -85,7 +85,7 @@ static char } static char - *get_special_var(const char varname[], + *u_get_special_var(const char varname[], t_msh *msh) { char *varval; @@ -114,7 +114,7 @@ static char } char - *get_cstm_vr(const char varname[], + *u_get_cstm_vr(const char varname[], t_msh *msh) { t_lvars *ptr; @@ -165,18 +165,18 @@ char char *rvarname; varval = NULL; - if ((varval = get_special_var(varname, msh)) != NULL) + if ((varval = u_get_special_var(varname, msh)) != NULL) { return (varval); } - else if ((varval = get_cstm_vr(varname, msh)) != NULL) + else if ((varval = u_get_cstm_vr(varname, msh)) != NULL) { return (varval); } else { - rvarname = set_rva(varname, msh); - varval = get_frm_env(rvarname, msh); + rvarname = u_set_rva(varname, msh); + varval = u_get_frm_env(rvarname, msh); return (varval); } return (NULL); |