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.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/m_prompt.c b/src/m_prompt.c
index d0269e4..dc17939 100644
--- a/src/m_prompt.c
+++ b/src/m_prompt.c
@@ -24,15 +24,21 @@ static char
*m_subst_prompt_rice(char var[], t_msh *msh)
{
char tmp[PATH_MAX];
+ char *ptr;
size_t i;
size_t j;
i = 0;
- while (var[i] != '\0')
+ while (var[i] != C_NUL)
{
- if (var[i] == '\\')
+ if (var[i] == C_BACKS)
{
- if (var[i + 1] == 'w')
+ 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);
+ var[i] = C_ESC;
+ }
+ else if (var[i + 1] == 'w')
{
u_get_var_value(tmp, "$PWD", PATH_MAX, msh);
if (tmp[0] != C_NUL)