summaryrefslogtreecommitdiffstats
path: root/src/m_prompt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/m_prompt.c')
-rw-r--r--src/m_prompt.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/m_prompt.c b/src/m_prompt.c
index 2d88088..ff491c8 100644
--- a/src/m_prompt.c
+++ b/src/m_prompt.c
@@ -34,9 +34,14 @@ static char
{
if (var[i + 1] == '0' && var[i + 2] == '3' && var[i + 3] == '3')
{
- ft_memmove(var + i, var + i + 3, ft_strlen(var + i + 3) + 1);
+ (void)ft_memmove(var + i, var + i + 3, ft_strlen(var + i + 3) + 1);
var[i] = C_ESC;
}
+ else if (var[i + 1] == 'n')
+ {
+ (void)ft_memmove(var + i, var + i + 1, ft_strlen(var + i + 1) + 1);
+ var[i] = C_LF;
+ }
else if (var[i + 1] == 'w')
{
u_get_var_value(tmp, "$PWD", PATH_MAX, msh);
@@ -65,9 +70,9 @@ static char
ft_strsubst_s(var, "\\w", "?");
}
else if (var[i + 1] == 'v')
- var = ft_strsubst(var, "\\v", FT_MSH_VERSION);
+ ft_strsubst_s(var, "\\v", FT_MSH_VERSION);
else if (var[i + 1] == 's')
- var = ft_strsubst(var, "\\s", FT_PROGNAME);
+ ft_strsubst_s(var, "\\s", FT_PROGNAME);
}
i++;
}