prompt update leak

This commit is contained in:
wescande 2017-03-19 18:33:44 +01:00
parent b7d2b120d8
commit ed0a3c791a

View file

@ -6,7 +6,7 @@
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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);
}