From 6bc3b1f99e7c8b5a5d58f20526543d860c7fdef0 Mon Sep 17 00:00:00 2001 From: salad Date: Mon, 2 Nov 2020 21:01:10 +0100 Subject: merge happenned --- src/m_loop_counter.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/m_loop_counter.c b/src/m_loop_counter.c index 430968a..d1d4dcf 100644 --- a/src/m_loop_counter.c +++ b/src/m_loop_counter.c @@ -24,7 +24,10 @@ char *m_counter_line_backslash(int fd, { char *counter_line; - c_gnl(fd, &counter_line, psx, msh); + if (fd == STDIN_FILENO) + c_gnl(fd, &counter_line, psx, msh); + else + get_next_line(fd, &counter_line); if (counter_line[0] != C_NUL) { l = ft_nrealloc(l, @@ -42,7 +45,10 @@ char *m_counter_line_pipes(int fd, unsigned char psx, char *line, t_msh *msh) { char *counter_line; - c_gnl(fd, &counter_line, psx, msh); + if (fd == STDIN_FILENO) + c_gnl(fd, &counter_line, psx, msh); + else + get_next_line(fd, &counter_line); if (counter_line[0] != C_NUL) { line = ft_nrealloc(line, @@ -63,7 +69,10 @@ char *m_counter_line_quotes(int fd, { char *counter_line; - c_gnl(fd, &counter_line, psx, msh); + if (fd == STDIN_FILENO) + c_gnl(fd, &counter_line, psx, msh); + else + get_next_line(fd, &counter_line); if (counter_line[0] != C_NUL) { line = ft_nrealloc(line, -- cgit v1.2.3