summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--heh3
-rw-r--r--qwe.salut1
-rw-r--r--sa.lut1
-rw-r--r--src/ft_m_loop.c7
4 files changed, 9 insertions, 3 deletions
diff --git a/heh b/heh
new file mode 100644
index 0000000..3de6e45
--- /dev/null
+++ b/heh
@@ -0,0 +1,3 @@
+salut
+les
+potes '
diff --git a/qwe.salut b/qwe.salut
new file mode 100644
index 0000000..74a42cf
--- /dev/null
+++ b/qwe.salut
@@ -0,0 +1 @@
+qwe"
diff --git a/sa.lut b/sa.lut
new file mode 100644
index 0000000..e62415c
--- /dev/null
+++ b/sa.lut
@@ -0,0 +1 @@
+qwe
diff --git a/src/ft_m_loop.c b/src/ft_m_loop.c
index 7c6259c..2280cfd 100644
--- a/src/ft_m_loop.c
+++ b/src/ft_m_loop.c
@@ -30,8 +30,6 @@ uint8_t
if (!(prog = ft_calloc(ft_strlen(line + 1), sizeof(char))))
return (0);
- if (!(fin = malloc((ft_strlen(prog) + ft_strlen(buf)) * sizeof(char))))
- return (0);
ft_memcpy(prog, line, (quote - line));
buf = ft_strdup(line + (quote - line) + 1);
gnl = 1;
@@ -42,14 +40,17 @@ uint8_t
ft_sprintf(buf + ft_strlen(buf), "\n%s", line);
}
buf = ft_strtrim(buf, "\"'");
+ if (!(fin = malloc((ft_strlen(prog) + ft_strlen(buf)) * sizeof(char))))
+ return (0);
fin = ft_strjoin(prog, buf);
ft_p_line(fin, msh);
ft_memdel((void*)&line);
ft_memdel((void*)&buf);
ft_memdel((void*)&fin);
+ ft_memdel((void*)&prog);
ft_e_lcom(msh);
ft_lcom_clear(&msh->curr);
- return (1); /*got second quote, keep going*/
+ return (1);
}
uint8_t