diff options
Diffstat (limited to '')
-rw-r--r-- | src/m_loop_next.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/m_loop_next.c b/src/m_loop_next.c index d7d3377..90ffc01 100644 --- a/src/m_loop_next.c +++ b/src/m_loop_next.c @@ -23,19 +23,13 @@ static char { char *counter_line; - /* if (fd == STDIN_FILENO) */ - /* m_prompt_psx(psx, msh); */ - /* get_next_line(fd, &counter_line); */ - c_init_tcaps(fd, &counter_line, psx, msh); - if (counter_line[0] != 0) - { - line = ft_nrealloc(line, - ft_strlen(line) + 1, - ft_strlen(line) + ft_strlen(counter_line)); - ft_memcpy(line + ft_strlen(line) - 1, - counter_line, - ft_strlen(counter_line) + 1); - } + c_gnl(fd, &counter_line, psx, msh); + line = ft_nrealloc(line, + ft_strlen(line) + 1, + ft_strlen(line) + ft_strlen(counter_line)); + ft_memcpy(line + ft_strlen(line) - 1, + counter_line, + ft_strlen(counter_line) + 1); ft_memdel((void*)&counter_line); return (line); } @@ -47,8 +41,7 @@ static char if (fd == STDIN_FILENO) m_prompt_psx(psx, msh); - /* get_next_line(fd, &counter_line); */ - c_init_tcaps(fd, &counter_line, psx, msh); + c_gnl(fd, &counter_line, psx, msh); if (counter_line[0] != 0) { line = ft_nrealloc(line, |