From f3aa0ec09673d85d0b5b5a4df0da2fe39d08a8ba Mon Sep 17 00:00:00 2001 From: Gautier Wojda Date: Mon, 27 Mar 2017 11:27:43 +0200 Subject: [PATCH] close prompt mal place --- 42sh/src/line_editing/ft_prompt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/42sh/src/line_editing/ft_prompt.c b/42sh/src/line_editing/ft_prompt.c index 3f12ed95..61a355a9 100644 --- a/42sh/src/line_editing/ft_prompt.c +++ b/42sh/src/line_editing/ft_prompt.c @@ -19,7 +19,6 @@ static int promt_git_status(int fd) char *line; get_next_line(fd, &line); - close(fd); tmp = line; if (ft_strrchr(line, '/')) line = ft_strdup(ft_strrchr(line, '/') + 1); @@ -36,6 +35,7 @@ static int promt_git_status(int fd) ft_strdel(&tmp); while (get_next_line(fd, &tmp) > 0) ft_strdel(&tmp); + close(fd); ft_strdel(&tmp); return (len + 8); }