diff --git a/Makefile b/Makefile index 4d4e100..30038f2 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,7 @@ LINCLUDE = -L$(LIBFTDIR) ifeq ($(CFLAGS),) CFLAGS = -Wall -Wextra -Werror \ + $(DEBUG) \ endif export CFLAGS diff --git a/src/executing/here_doc/here_doc_utils.c b/src/executing/here_doc/here_doc_utils.c index d84a774..4677987 100644 --- a/src/executing/here_doc/here_doc_utils.c +++ b/src/executing/here_doc/here_doc_utils.c @@ -3,10 +3,10 @@ /* ::: :::::::: */ /* here_doc_utils.c :+: :+: :+: */ /* +:+ +:+ +:+ */ -/* By: jguelen +#+ +:+ +#+ */ +/* By: kcolin +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ -/* Created: 2025/04/17 11:50:08 by kcolin #+# #+# */ -/* Updated: 2025/05/02 12:47:12 by jguelen ### ########.fr */ +/* Created: 2025/05/02 14:36:33 by kcolin #+# #+# */ +/* Updated: 2025/05/02 14:36:33 by kcolin ### ########.fr */ /* */ /* ************************************************************************** */ @@ -48,7 +48,6 @@ char *finalize(int outfd, char *filename) int interupted(int outfd, char *filename) { - ft_printf("\n"); close(outfd); unlink(filename); free(filename); diff --git a/src/parser/cmd/cmd_destroy.c b/src/parser/cmd/cmd_destroy.c index 88f7b76..b9af927 100644 --- a/src/parser/cmd/cmd_destroy.c +++ b/src/parser/cmd/cmd_destroy.c @@ -6,7 +6,7 @@ /* By: kcolin +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/04/09 16:53:02 by kcolin #+# #+# */ -/* Updated: 2025/04/30 18:00:28 by kcolin ### ########.fr */ +/* Updated: 2025/05/02 14:35:54 by kcolin ### ########.fr */ /* */ /* ************************************************************************** */ @@ -23,7 +23,8 @@ void redirect_destroy(t_redirect *redirect) { next = redirect->next; free(redirect->here_doc_eof); - if (redirect->type == FT_HEREDOC) + if (redirect->type == FT_HEREDOC && redirect->redirectee.filename != NULL + && redirect->redirectee.filename->word != NULL) unlink(redirect->redirectee.filename->word); worddesc_destroy(redirect->redirectee.filename); free(redirect->unexpanded_filename); diff --git a/src/parser/redirect/redirect_from_words.c b/src/parser/redirect/redirect_from_words.c index c736066..7cab2f6 100644 --- a/src/parser/redirect/redirect_from_words.c +++ b/src/parser/redirect/redirect_from_words.c @@ -5,8 +5,8 @@ /* +:+ +:+ +:+ */ /* By: kcolin +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ -/* Created: 2025/04/30 10:35/43 by kcolin #+# #+# */ -/* Updated: 2025/04/30 10:35:43 by kcolin ### ########.fr */ +/* Created: 2025/05/02 14:40:34 by kcolin #+# #+# */ +/* Updated: 2025/05/02 14:40:34 by kcolin ### ########.fr */ /* */ /* ************************************************************************** */ @@ -83,7 +83,7 @@ t_redirect *redir_from_words(t_worddesc *operator, here_doc(spec, STDIN_FILENO, app), 0, NULL, WORD_TOKEN); worddesc_destroy(spec); if (redir->redirectee.filename == NULL) - return (redirect_destroy(redir), ft_errno(FT_EERRNO), NULL); + return (redirect_destroy(redir), NULL); } else redir->redirectee.filename = specifier;