Skip to content

Commit

Permalink
2nd attempt to fix, now a leak
Browse files Browse the repository at this point in the history
  • Loading branch information
biralavor committed Oct 10, 2024
1 parent a410cfd commit 870a0b3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ LIBS = $(LIBFT)
NAME = minishell

SRC_FILES = 01.main.c
SRC_FILES += minishell_init.c
SRC_FILES += 02.minishell_init.c
SRC_FILES += 02.signals.c
SRC_FILES += 03.env_init.c
SRC_FILES += 04.env_init_utils.c
Expand Down
4 changes: 3 additions & 1 deletion src/01.main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: umeneses <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/06/12 10:53:12 by umeneses #+# #+# */
/* Updated: 2024/10/10 10:43:06 by umeneses ### ########.fr */
/* Updated: 2024/10/10 16:08:09 by umeneses ### ########.fr */
/* */
/* ************************************************************************** */

Expand All @@ -31,6 +31,8 @@ int main(int ac, char **av, char **envp)
if (addto_history_detector(input))
add_history(input);
loop_routine(input);
if (g_sigmonitor == SIGUSR1)
token_list_holder(NULL, false, true);
wait(NULL);
free(input);
}
Expand Down
4 changes: 2 additions & 2 deletions src/minishell_init.c → src/02.minishell_init.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* minishell_init.c :+: :+: :+: */
/* 02.minishell_init.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: umeneses <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/10 08:02:42 by umeneses #+# #+# */
/* Updated: 2024/10/10 08:23:38 by umeneses ### ########.fr */
/* Updated: 2024/10/10 16:06:06 by umeneses ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down
6 changes: 3 additions & 3 deletions src/05.loop_routine.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: umeneses <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/06/19 09:20:45 by tmalheir #+# #+# */
/* Updated: 2024/10/10 15:39:51 by umeneses ### ########.fr */
/* Updated: 2024/10/10 16:07:33 by umeneses ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -58,9 +58,9 @@ void loop_routine(char *str)
if (heredoc_detector(lst))
manage_heredoc(lst);
if (g_sigmonitor == SIGUSR1
&& !child_process_is_running(false, true))
&& !child_process_is_running(false, true))
{
free_token_list(&lst);
token_list_holder(NULL, false, true);
g_sigmonitor = 0;
return ;
}
Expand Down

0 comments on commit 870a0b3

Please sign in to comment.