summaryrefslogtreecommitdiffstats
path: root/src/ft_m_loop.c
diff options
context:
space:
mode:
authorsalad <fmoenne-@student.le-101.fr>2020-04-28 19:22:21 +0200
committersalad <fmoenne-@student.le-101.fr>2020-04-28 19:22:21 +0200
commit831aa4a82679290e89cc2b4405c6c12985b3451b (patch)
treed525282a499f3eb64520f28668a46afa728c99c0 /src/ft_m_loop.c
parentcleanup (diff)
download42-minishell-831aa4a82679290e89cc2b4405c6c12985b3451b.tar.gz
42-minishell-831aa4a82679290e89cc2b4405c6c12985b3451b.tar.bz2
42-minishell-831aa4a82679290e89cc2b4405c6c12985b3451b.tar.xz
42-minishell-831aa4a82679290e89cc2b4405c6c12985b3451b.tar.zst
42-minishell-831aa4a82679290e89cc2b4405c6c12985b3451b.zip
simple really
Diffstat (limited to '')
-rw-r--r--src/ft_m_loop.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ft_m_loop.c b/src/ft_m_loop.c
index 2280cfd..1797c93 100644
--- a/src/ft_m_loop.c
+++ b/src/ft_m_loop.c
@@ -24,6 +24,7 @@ uint8_t
ft_m_loop_cont(t_msh *msh, char *line, char *quote)
{
int8_t gnl;
+ size_t len;
char *prog;
char *buf;
char *fin;
@@ -37,6 +38,8 @@ uint8_t
{
ft_m_cont_prompt();
gnl = get_next_line(STDIN_FILENO, &line);
+ len = ft_strlen(buf);
+ buf = ft_nrealloc(buf, len, (len + ft_strlen(line)));
ft_sprintf(buf + ft_strlen(buf), "\n%s", line);
}
buf = ft_strtrim(buf, "\"'");