diff --git a/42sh/src/line_editing/ft_prompt.c b/42sh/src/line_editing/ft_prompt.c index 8de676fc..26bfafaf 100644 --- a/42sh/src/line_editing/ft_prompt.c +++ b/42sh/src/line_editing/ft_prompt.c @@ -6,7 +6,7 @@ /* By: gwojda +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/13 13:51:33 by gwojda #+# #+# */ -/* Updated: 2017/03/19 18:02:08 by wescande ### ########.fr */ +/* Updated: 2017/03/19 18:07:11 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ @@ -26,6 +26,8 @@ static int promt_git_status(int fd) line = ft_strdup(line + 3); ft_strdel(&tmp); ft_printf("\x1b[38;5;47mgit:(\x1b[38;5;203m%s\x1b[38;5;47m)", line); + len = ft_strlen(line); + ft_strdel(&line); if (!get_next_line(fd, &tmp)) ft_printf("\x1b[38;5;83m ✓ "); else @@ -36,8 +38,6 @@ static int promt_git_status(int fd) while (get_next_line(fd, &tmp) > 0) ft_strdel(&tmp); ft_strdel(&tmp); - len = ft_strlen(line); - ft_strdel(&line); return (len + 8); }