summaryrefslogtreecommitdiffstats
path: root/src/p_lcom_next.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-08-17 18:12:18 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-08-17 18:12:18 +0200
commit598c360d22fa9b3c863f74bb6280472fd805fa0d (patch)
tree0f4da458afd6ee66a9aa203df459e061970de5a1 /src/p_lcom_next.c
parentSet libft/ft_is* to type t_bool (diff)
download42-minishell-598c360d22fa9b3c863f74bb6280472fd805fa0d.tar.gz
42-minishell-598c360d22fa9b3c863f74bb6280472fd805fa0d.tar.bz2
42-minishell-598c360d22fa9b3c863f74bb6280472fd805fa0d.tar.xz
42-minishell-598c360d22fa9b3c863f74bb6280472fd805fa0d.tar.zst
42-minishell-598c360d22fa9b3c863f74bb6280472fd805fa0d.zip
Fixed unset not working
Diffstat (limited to 'src/p_lcom_next.c')
-rw-r--r--src/p_lcom_next.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/p_lcom_next.c b/src/p_lcom_next.c
index 3f18ec1..b04d393 100644
--- a/src/p_lcom_next.c
+++ b/src/p_lcom_next.c
@@ -101,6 +101,28 @@ char
return (words);
}
+char
+ **p_subst_home(char *words[],
+ t_msh *msh)
+{
+ char *path;
+ char **ptr;
+
+ if ((path = u_get_var_value("$HOME", msh)) == NULL)
+ return (words);
+ ptr = words;
+ while (*ptr != NULL)
+ {
+ if (*ptr[0] == '~')
+ {
+ *ptr = ft_strsubst(*ptr, "~", path);
+ }
+ ptr++;
+ }
+ ft_memdel((void*)&path);
+ return (words);
+}
+
static void
p_register_word(char word[],
t_msh *msh)