summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-09-27 21:28:03 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-09-27 21:28:03 +0200
commit1b3870cc58fc4893d12b45689a4efe7f2bbe272f (patch)
tree422c6b591f873eb65d44b8fbfbc60db010842b59 /src
parentIn progress (diff)
download42-minishell-1b3870cc58fc4893d12b45689a4efe7f2bbe272f.tar.gz
42-minishell-1b3870cc58fc4893d12b45689a4efe7f2bbe272f.tar.bz2
42-minishell-1b3870cc58fc4893d12b45689a4efe7f2bbe272f.tar.xz
42-minishell-1b3870cc58fc4893d12b45689a4efe7f2bbe272f.tar.zst
42-minishell-1b3870cc58fc4893d12b45689a4efe7f2bbe272f.zip
later
Diffstat (limited to 'src')
-rw-r--r--src/p_redirs_heredoc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/p_redirs_heredoc.c b/src/p_redirs_heredoc.c
index 7c2ef90..fd5b399 100644
--- a/src/p_redirs_heredoc.c
+++ b/src/p_redirs_heredoc.c
@@ -35,13 +35,16 @@ char
m_prompt_psx(2, msh);
gnl = get_next_line(msh->fd, &line);
if (ft_strncmp(path, line, ft_strlen(path) + 1) != 0)
- return (heredoc);
+ break ;
if ((heredoc = ft_nrealloc(heredoc, ft_strlen(heredoc),
ft_strlen(heredoc) + ft_strlen(line) + 2)) == NULL)
- return (heredoc);
+ break ;
ft_strlcpy(heredoc + ft_strlen(heredoc), line, ft_strlen(line) + 1);
heredoc[ft_strlen(heredoc) + 1] = C_NUL;
heredoc[ft_strlen(heredoc)] = C_LF;
+ ft_memdel((void*)&line);
+
}
+ ft_memdel((void*)&line);
return (heredoc);
}