summaryrefslogtreecommitdiffstats
path: root/src/ft_m_loop.c
diff options
context:
space:
mode:
authorsalad <fmoenne-@student.le-101.fr>2020-04-30 17:17:43 +0200
committersalad <fmoenne-@student.le-101.fr>2020-04-30 17:17:43 +0200
commit449bfc8e6d34b9355dd703b70e8006df426dfc45 (patch)
tree7132085c69930f2bff49fb087673be556342daea /src/ft_m_loop.c
parentalesgut (not gut) (diff)
download42-minishell-449bfc8e6d34b9355dd703b70e8006df426dfc45.tar.gz
42-minishell-449bfc8e6d34b9355dd703b70e8006df426dfc45.tar.bz2
42-minishell-449bfc8e6d34b9355dd703b70e8006df426dfc45.tar.xz
42-minishell-449bfc8e6d34b9355dd703b70e8006df426dfc45.tar.zst
42-minishell-449bfc8e6d34b9355dd703b70e8006df426dfc45.zip
yessaye
Diffstat (limited to '')
-rw-r--r--src/ft_m_loop.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ft_m_loop.c b/src/ft_m_loop.c
index 6e649b6..0b590a0 100644
--- a/src/ft_m_loop.c
+++ b/src/ft_m_loop.c
@@ -52,11 +52,11 @@ void
ft_m_loop_cont(t_msh *msh,
char *line,
char *quote,
- int8_t gnl)
+ int8_t gnl)
{
- char *prog;
- char *buf;
- char *fin;
+ char *prog;
+ char *buf;
+ char *fin;
if (!(prog = ft_calloc(ft_strlen(line) + 1, sizeof(char))) ||
!(buf = ft_strdup(line + (quote - line) + 1)))
@@ -72,9 +72,9 @@ void
}
fin = ft_strtrim(buf, "\"'");
ft_memdel((void*)&buf);
+ fin = (ft_strrchr(fin, '\'')) ? ft_strsubst(fin, "\'", "") : fin;
fin = ft_strjoin_m(prog, fin, 1);
ft_p_line(fin, msh);
- ft_printf("fin : %s\n", fin);
ft_memdel((void*)&prog);
ft_memdel((void*)&fin);
ft_e_lcom(msh);