From 40547b1e65f89bff8bec36f91cebc2e1669d6e13 Mon Sep 17 00:00:00 2001 From: wescande Date: Fri, 24 Mar 2017 12:42:14 +0100 Subject: [PATCH] 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 --- 42sh/src/job_control/builtin_jobs.c | 4 +++- 42sh/src/main/data_exit.c | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/42sh/src/job_control/builtin_jobs.c b/42sh/src/job_control/builtin_jobs.c index dccdc8cb..7a4c35b3 100644 --- a/42sh/src/job_control/builtin_jobs.c +++ b/42sh/src/job_control/builtin_jobs.c @@ -6,7 +6,7 @@ /* 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)envp; + ft_bzero(&data, sizeof(t_data_template)); + do_job_notification(); if (!SH_HAS_JOBC(data_singleton()->opts)) { SH_ERR("jobs: %s", SH_MSG_NOJOBC); diff --git a/42sh/src/main/data_exit.c b/42sh/src/main/data_exit.c index 1dc92723..e0f79a5f 100644 --- a/42sh/src/main/data_exit.c +++ b/42sh/src/main/data_exit.c @@ -6,7 +6,7 @@ /* 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); lexer_destroy(&data->lexer); parser_destroy(&data->parser); + ft_lstdel(&data->jobc.first_job, &job_free); ft_save_termios(-1); ft_free_hash_table(); free_history_list(data_singleton()->line.list_beg);