From 20b9a703186d7bf06936467ae3e8108cfbee43dd Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Thu, 10 Sep 2020 19:28:08 +0200 Subject: I was born an idiot I swear --- src/m_prompt.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/m_prompt.c') 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) -- cgit v1.2.3