summaryrefslogtreecommitdiffstats
path: root/src/p_lcom_next.c
diff options
context:
space:
mode:
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)