diff options
Diffstat (limited to '')
-rw-r--r-- | src/m_loop.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/m_loop.c b/src/m_loop.c index 140d009..84efddf 100644 --- a/src/m_loop.c +++ b/src/m_loop.c @@ -82,7 +82,7 @@ void } uint8_t - m_loop(t_msh *msh) + m_loop(int32_t fd, t_msh *msh) { char *line; char *quote; @@ -91,8 +91,9 @@ uint8_t gnl = 1; while (gnl > 0) { - m_prompt(msh); - gnl = get_next_line(STDIN_FILENO, &line); + if (fd == STDIN_FILENO) + m_prompt(msh); + gnl = get_next_line(fd, &line); if (line[0] != '\0') { if (!(quote = ft_strchr(line, '\'')) && !(quote = ft_strchr(line, '\"'))) |