HELP ME ALAO PLS

This commit is contained in:
gwojda 2017-03-21 14:43:38 +01:00
parent 83ea52445a
commit ea91da06f4
5 changed files with 16 additions and 11 deletions

View file

@ -6,7 +6,7 @@
/* By: alao <alao@student.42.fr> +#+ +:+ +#+ */ /* By: alao <alao@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/01/10 11:37:43 by alao #+# #+# */ /* Created: 2017/01/10 11:37:43 by alao #+# #+# */
/* Updated: 2017/03/21 12:01:02 by gwojda ### ########.fr */ /* Updated: 2017/03/21 14:02:41 by gwojda ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -65,5 +65,6 @@ int c_clear(t_data *s)
c_clear_lst(ptr); c_clear_lst(ptr);
s->comp ? ft_memdel((void *)&s->comp) : (0); s->comp ? ft_memdel((void *)&s->comp) : (0);
s->comp = NULL; s->comp = NULL;
data_singleton()->comp = NULL;
return (0); return (0);
} }

View file

@ -6,7 +6,7 @@
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */ /* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/09 16:54:59 by gwojda #+# #+# */ /* Created: 2017/03/09 16:54:59 by gwojda #+# #+# */
/* Updated: 2017/03/19 15:22:06 by gwojda ### ########.fr */ /* Updated: 2017/03/21 14:24:25 by gwojda ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: alao <alao@student.42.fr> +#+ +:+ +#+ */ /* By: alao <alao@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/01/09 13:31:21 by alao #+# #+# */ /* Created: 2017/01/09 13:31:21 by alao #+# #+# */
/* Updated: 2017/03/21 13:41:24 by gwojda ### ########.fr */ /* Updated: 2017/03/21 14:37:27 by gwojda ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -32,10 +32,11 @@ int c_exclusion_folder(t_comp *c)
{ {
tmp ? ft_memdel((void *)&tmp) : (0); tmp ? ft_memdel((void *)&tmp) : (0);
if (c->rcmd[ft_strlen(c->rcmd) - 1] == '/') if (c->rcmd[ft_strlen(c->rcmd) - 1] == '/')
/* { {
c_clear(data_singleton());*/ c_clear(data_singleton());
return (0); return (0);
/* }*/ }
DG("c->match = \"%s\"", c->match);
tmp2 = ft_strjoin(c->match, "/"); tmp2 = ft_strjoin(c->match, "/");
c_updater(c, tmp2); c_updater(c, tmp2);
tmp2 ? ft_memdel((void *)&tmp2) : (0); tmp2 ? ft_memdel((void *)&tmp2) : (0);

View file

@ -6,7 +6,7 @@
/* By: alao <alao@student.42.fr> +#+ +:+ +#+ */ /* By: alao <alao@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/02/15 12:03:30 by alao #+# #+# */ /* Created: 2017/02/15 12:03:30 by alao #+# #+# */
/* Updated: 2017/03/21 12:07:21 by gwojda ### ########.fr */ /* Updated: 2017/03/21 14:23:01 by gwojda ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -50,17 +50,20 @@ int c_rematch(t_comp *c, long int keypress)
{ {
if (ft_isascii(keypress)) if (ft_isascii(keypress))
{ {
DG("before rematch = \"%s\"", data_singleton()->line.input);
c->isrematch = 1; c->isrematch = 1;
c_term_clear(c); c_term_clear(c);
c_refresh_match(c, keypress); c_refresh_match(c, keypress);
c_clear_lst(c); c_clear_lst(c);
c_matching(data_singleton(), c); c_matching(data_singleton(), c);
if (c->lst == NULL) DG("after matching = \"%s\"", data_singleton()->line.input);
if (data_singleton()->comp && c->lst == NULL)
c_clear(data_singleton()); c_clear(data_singleton());
else if (c->lst == c->lst->next) else if (data_singleton()->comp && c->lst == c->lst->next)
return (1); return (1);
ft_print(keypress, &data_singleton()->line.input, ft_print(keypress, &data_singleton()->line.input,
&data_singleton()->line.pos); &data_singleton()->line.pos);
DG("after rematch = \"%s\"", data_singleton()->line.input);
return (1); return (1);
} }
else else

View file

@ -6,7 +6,7 @@
/* By: alao <alao@student.42.fr> +#+ +:+ +#+ */ /* By: alao <alao@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/02/03 13:10:38 by alao #+# #+# */ /* Created: 2017/02/03 13:10:38 by alao #+# #+# */
/* Updated: 2017/03/19 15:18:55 by gwojda ### ########.fr */ /* Updated: 2017/03/21 14:37:14 by gwojda ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -33,7 +33,7 @@ static int c_updater_rcmd(t_comp *c)
ft_memdel((void *)&data_singleton()->line.input); ft_memdel((void *)&data_singleton()->line.input);
data_singleton()->line.input = ft_strdup(c->rcmd); data_singleton()->line.input = ft_strdup(c->rcmd);
} }
new_pos = ft_strlen(c->start) + ft_strlen(c->between) + ft_strlen(c->rcmd); new_pos = ft_strlen(c->rcmd);
data_singleton()->line.pos = new_pos; data_singleton()->line.pos = new_pos;
tmp ? ft_memdel((void *)&tmp) : (0); tmp ? ft_memdel((void *)&tmp) : (0);
tmp2 ? ft_memdel((void *)&tmp2) : (0); tmp2 ? ft_memdel((void *)&tmp2) : (0);