rectif prompt leaks
This commit is contained in:
parent
ac27fb4ce1
commit
b7d2b120d8
1 changed files with 6 additions and 6 deletions
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
|
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2016/12/13 13:51:33 by gwojda #+# #+# */
|
/* Created: 2016/12/13 13:51:33 by gwojda #+# #+# */
|
||||||
/* Updated: 2017/03/18 14:23:53 by gwojda ### ########.fr */
|
/* Updated: 2017/03/19 18:02:08 by wescande ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
@ -24,18 +24,18 @@ static int promt_git_status(int fd)
|
||||||
line = ft_strdup(ft_strrchr(line, '/') + 1);
|
line = ft_strdup(ft_strrchr(line, '/') + 1);
|
||||||
else
|
else
|
||||||
line = ft_strdup(line + 3);
|
line = ft_strdup(line + 3);
|
||||||
free(tmp);
|
ft_strdel(&tmp);
|
||||||
ft_printf("\x1b[38;5;47mgit:(\x1b[38;5;203m%s\x1b[38;5;47m)", line);
|
ft_printf("\x1b[38;5;47mgit:(\x1b[38;5;203m%s\x1b[38;5;47m)", line);
|
||||||
if (!get_next_line(fd, &tmp))
|
if (!get_next_line(fd, &tmp))
|
||||||
ft_printf("\x1b[38;5;83m ✓ ");
|
ft_printf("\x1b[38;5;83m ✓ ");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ft_printf("\x1b[38;5;1m ✗ ");
|
ft_printf("\x1b[38;5;1m ✗ ");
|
||||||
free(tmp);
|
ft_strdel(&tmp);
|
||||||
}
|
}
|
||||||
while (get_next_line(fd, &tmp))
|
while (get_next_line(fd, &tmp) > 0)
|
||||||
free(tmp);
|
ft_strdel(&tmp);
|
||||||
free(tmp);
|
ft_strdel(&tmp);
|
||||||
len = ft_strlen(line);
|
len = ft_strlen(line);
|
||||||
ft_strdel(&line);
|
ft_strdel(&line);
|
||||||
return (len + 8);
|
return (len + 8);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue