diff options
author | salad <fmoenne-@student.le-101.fr> | 2020-11-02 21:37:01 +0100 |
---|---|---|
committer | salad <fmoenne-@student.le-101.fr> | 2020-11-02 21:37:01 +0100 |
commit | 765a2b4ff157f3303f0f8d7d6379cb849004a679 (patch) | |
tree | d6cdb352bd539667dd56c76562a0cba11cc9dc9a /src/m_loop.c | |
parent | merge happenned (diff) | |
download | 42-minishell-765a2b4ff157f3303f0f8d7d6379cb849004a679.tar.gz 42-minishell-765a2b4ff157f3303f0f8d7d6379cb849004a679.tar.bz2 42-minishell-765a2b4ff157f3303f0f8d7d6379cb849004a679.tar.xz 42-minishell-765a2b4ff157f3303f0f8d7d6379cb849004a679.tar.zst 42-minishell-765a2b4ff157f3303f0f8d7d6379cb849004a679.zip |
strplen
Diffstat (limited to 'src/m_loop.c')
-rw-r--r-- | src/m_loop.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/m_loop.c b/src/m_loop.c index 94e3027..83caf6a 100644 --- a/src/m_loop.c +++ b/src/m_loop.c @@ -138,7 +138,10 @@ unsigned char m_loop(int fd, t_msh *msh) msh->curr_hist_ptr = hist; while (gnl > 0) { - gnl = c_gnl(fd, &line, 1, msh); + if (fd == STDIN_FILENO) + gnl = c_gnl(fd, &line, 1, msh); + else + gnl = get_next_line(fd, &line); m_delete_comments(line); if (line[0] != C_NUL) { |