summaryrefslogtreecommitdiffstats
path: root/src/m_prompt.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-09-10 19:53:00 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-09-10 19:53:00 +0200
commit89c27ba72e11665823cba7023f694a8639891ccb (patch)
treedfdd9771eb2e4bb2ae5d354424350a8edcfbd43b /src/m_prompt.c
parentI was born an idiot I swear (diff)
download42-minishell-89c27ba72e11665823cba7023f694a8639891ccb.tar.gz
42-minishell-89c27ba72e11665823cba7023f694a8639891ccb.tar.bz2
42-minishell-89c27ba72e11665823cba7023f694a8639891ccb.tar.xz
42-minishell-89c27ba72e11665823cba7023f694a8639891ccb.tar.zst
42-minishell-89c27ba72e11665823cba7023f694a8639891ccb.zip
New libft func, cool stuff
Diffstat (limited to 'src/m_prompt.c')
-rw-r--r--src/m_prompt.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/m_prompt.c b/src/m_prompt.c
index dc17939..2d88088 100644
--- a/src/m_prompt.c
+++ b/src/m_prompt.c
@@ -24,7 +24,6 @@ static char
*m_subst_prompt_rice(char var[], t_msh *msh)
{
char tmp[PATH_MAX];
- char *ptr;
size_t i;
size_t j;
@@ -42,9 +41,9 @@ static char
{
u_get_var_value(tmp, "$PWD", PATH_MAX, msh);
if (tmp[0] != C_NUL)
- var = ft_strsubst(var, "\\w", tmp);
+ ft_strsubst_s(var, "\\w", tmp);
else
- var = ft_strsubst(var, "\\w", "?");
+ ft_strsubst_s(var, "\\w", "?");
}
else if (var[i + 1] == 'W')
{
@@ -60,10 +59,10 @@ static char
(void)ft_memmove(tmp, tmp + j,
((ft_strlen(tmp) - j) + 1) * sizeof(char));
}
- var = ft_strsubst(var, "\\W", tmp);
+ ft_strsubst_s(var, "\\W", tmp);
}
else
- var = ft_strsubst(var, "\\w", "?");
+ ft_strsubst_s(var, "\\w", "?");
}
else if (var[i + 1] == 'v')
var = ft_strsubst(var, "\\v", FT_MSH_VERSION);