rectif job_control pour :

plus d'affichage en double lorsque qu'on fait jobs
initialisation de toutes les variables
suppression des leaks quand on exit
This commit is contained in:
wescande 2017-03-24 12:42:14 +01:00
parent b8e3fddce3
commit 40547b1e65
2 changed files with 5 additions and 2 deletions

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */ /* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/15 17:43:01 by jhalford #+# #+# */ /* Created: 2016/12/15 17:43:01 by jhalford #+# #+# */
/* Updated: 2017/03/21 15:15:05 by jhalford ### ########.fr */ /* Updated: 2017/03/24 12:35:04 by wescande ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -66,6 +66,8 @@ int builtin_jobs(const char *path, char *const av[], char *const envp[])
(void)path; (void)path;
(void)envp; (void)envp;
ft_bzero(&data, sizeof(t_data_template));
do_job_notification();
if (!SH_HAS_JOBC(data_singleton()->opts)) if (!SH_HAS_JOBC(data_singleton()->opts))
{ {
SH_ERR("jobs: %s", SH_MSG_NOJOBC); SH_ERR("jobs: %s", SH_MSG_NOJOBC);

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */ /* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/07 18:07:50 by jhalford #+# #+# */ /* Created: 2016/12/07 18:07:50 by jhalford #+# #+# */
/* Updated: 2017/03/23 13:29:40 by jhalford ### ########.fr */ /* Updated: 2017/03/24 12:40:41 by wescande ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -22,6 +22,7 @@ void data_exit(void)
ft_sstrfree(data->argv); ft_sstrfree(data->argv);
lexer_destroy(&data->lexer); lexer_destroy(&data->lexer);
parser_destroy(&data->parser); parser_destroy(&data->parser);
ft_lstdel(&data->jobc.first_job, &job_free);
ft_save_termios(-1); ft_save_termios(-1);
ft_free_hash_table(); ft_free_hash_table();
free_history_list(data_singleton()->line.list_beg); free_history_list(data_singleton()->line.list_beg);