mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-05 23:18:08 +01:00
Compare commits
8 commits
5ea55a9f9c
...
58a27d712b
| Author | SHA1 | Date | |
|---|---|---|---|
| 58a27d712b | |||
| 826abdf623 | |||
| 04eabf096d | |||
|
|
3ae29cbdf7 | ||
| f8f3d8ccca | |||
| 4b08629bef | |||
| a8c3473b1a | |||
| 95451520d6 |
151 changed files with 647 additions and 491 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: kcolin <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/12/12 12:39:58 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/09 17:26:24 by khais ### ########.fr */
|
||||
/* Updated: 2025/04/09 17:26:24 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: kcolin <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/12/12 12:35:28 by kcolin #+# #+# */
|
||||
/* Updated: 2025/03/10 18:45:44 by khais ### ########.fr */
|
||||
/* Updated: 2025/03/10 18:45:44 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* buffer_charptr.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/03/10 18:45:49 by khais #+# #+# */
|
||||
/* Updated: 2025/03/10 18:46:35 by khais ### ########.fr */
|
||||
/* Created: 2025/03/10 18:45:49 by kcolin #+# #+# */
|
||||
/* Updated: 2025/03/10 18:46:35 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
6
src/env/env.c
vendored
6
src/env/env.c
vendored
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* env.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/19 13:59:20 by khais #+# #+# */
|
||||
/* Updated: 2025/02/19 14:42:35 by khais ### ########.fr */
|
||||
/* Created: 2025/02/19 13:59:20 by kcolin #+# #+# */
|
||||
/* Updated: 2025/02/19 14:42:35 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
6
src/env/env.h
vendored
6
src/env/env.h
vendored
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* env.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/19 13:58:41 by khais #+# #+# */
|
||||
/* Updated: 2025/02/19 14:41:51 by khais ### ########.fr */
|
||||
/* Created: 2025/02/19 13:58:41 by kcolin #+# #+# */
|
||||
/* Updated: 2025/02/19 14:41:51 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
6
src/env/env_convert.c
vendored
6
src/env/env_convert.c
vendored
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* env_convert.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/19 14:39:57 by khais #+# #+# */
|
||||
/* Updated: 2025/02/19 16:41:08 by khais ### ########.fr */
|
||||
/* Created: 2025/02/19 14:39:57 by kcolin #+# #+# */
|
||||
/* Updated: 2025/02/19 16:41:08 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
6
src/env/env_convert.h
vendored
6
src/env/env_convert.h
vendored
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* env_convert.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/19 14:38:43 by khais #+# #+# */
|
||||
/* Updated: 2025/02/19 16:42:27 by khais ### ########.fr */
|
||||
/* Created: 2025/02/19 14:38:43 by kcolin #+# #+# */
|
||||
/* Updated: 2025/02/19 16:42:27 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
2
src/env/env_manip.c
vendored
2
src/env/env_manip.c
vendored
|
|
@ -5,7 +5,7 @@
|
|||
/* +:+ +:+ +:+ */
|
||||
/* By: jguelen <jguelen@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/03/19 17:55:24 by khais #+# #+# */
|
||||
/* Created: 2025/03/19 17:55:24 by kcolin #+# #+# */
|
||||
/* Updated: 2025/03/21 18:49:56 by jguelen ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
|
|
|||
2
src/env/env_manip.h
vendored
2
src/env/env_manip.h
vendored
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jguelen <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/14 13:46:39 by jguelen #+# #+# */
|
||||
/* Updated: 2025/02/19 16:39:16 by khais ### ########.fr */
|
||||
/* Updated: 2025/02/19 16:39:16 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
6
src/env/envp.c
vendored
6
src/env/envp.c
vendored
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* envp.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/19 13:35:44 by khais #+# #+# */
|
||||
/* Updated: 2025/02/19 13:43:19 by khais ### ########.fr */
|
||||
/* Created: 2025/02/19 13:35:44 by kcolin #+# #+# */
|
||||
/* Updated: 2025/02/19 13:43:19 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
6
src/env/envp.h
vendored
6
src/env/envp.h
vendored
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* envp.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/19 13:32:34 by khais #+# #+# */
|
||||
/* Updated: 2025/02/19 13:35:37 by khais ### ########.fr */
|
||||
/* Created: 2025/02/19 13:32:34 by kcolin #+# #+# */
|
||||
/* Updated: 2025/02/19 13:35:37 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* cmd_execute.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/04 19:26:37 by khais #+# #+# */
|
||||
/* Updated: 2025/04/29 15:10:47 by khais ### ########.fr */
|
||||
/* Created: 2025/04/04 19:26:37 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/29 15:10:47 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* cmd_execute.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/04 19:25:39 by khais #+# #+# */
|
||||
/* Updated: 2025/04/29 15:10:53 by khais ### ########.fr */
|
||||
/* Created: 2025/04/04 19:25:39 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/29 15:10:53 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* do_waitpid.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/04 19:55:22 by khais #+# #+# */
|
||||
/* Updated: 2025/04/28 12:29:50 by khais ### ########.fr */
|
||||
/* Created: 2025/04/04 19:55:22 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/28 12:29:50 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* do_waitpid.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/04 19:54:53 by khais #+# #+# */
|
||||
/* Updated: 2025/04/04 19:57:07 by khais ### ########.fr */
|
||||
/* Created: 2025/04/04 19:54:53 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/04 19:57:07 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* connec_cmd_execute.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/07 10:38:55 by khais #+# #+# */
|
||||
/* Updated: 2025/04/29 15:11:32 by khais ### ########.fr */
|
||||
/* Created: 2025/04/07 10:38:55 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/29 15:11:32 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* connec_cmd_execute.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/07 10:38:19 by khais #+# #+# */
|
||||
/* Updated: 2025/04/29 15:10:00 by khais ### ########.fr */
|
||||
/* Created: 2025/04/07 10:38:19 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/29 15:10:00 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,31 +3,20 @@
|
|||
/* ::: :::::::: */
|
||||
/* connec_pipe_cmd_execute.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/11 12:01:29 by khais #+# #+# */
|
||||
/* Updated: 2025/04/29 15:11:23 by khais ### ########.fr */
|
||||
/* Created: 2025/04/11 12:01:29 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/30 11:49:59 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "../../ft_errno.h"
|
||||
#include "connec_pipe_cmd_execute.h"
|
||||
#include "../common/do_waitpid.h"
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include "../cmd/cmd_execute.h"
|
||||
|
||||
static void pipe_do_close(int pipefd[2])
|
||||
{
|
||||
close(pipefd[0]);
|
||||
close(pipefd[1]);
|
||||
}
|
||||
|
||||
static void dup_and_close(int fd, int fd2, int pipefd[2])
|
||||
{
|
||||
dup2(fd, fd2);
|
||||
pipe_do_close(pipefd);
|
||||
}
|
||||
|
||||
static int do_pipe(int pipefd[2], t_minishell *app)
|
||||
{
|
||||
if (pipe(pipefd) < 0)
|
||||
|
|
@ -39,11 +28,52 @@ static int do_pipe(int pipefd[2], t_minishell *app)
|
|||
return (0);
|
||||
}
|
||||
|
||||
static void close_and_wait(t_minishell *app, int pid1, int pid2, int pipefd[2])
|
||||
static void fork_failure(t_minishell *app, int pipefd[2])
|
||||
{
|
||||
pipe_do_close(pipefd);
|
||||
do_waitpid(app, pid1);
|
||||
do_waitpid(app, pid2);
|
||||
perror("minishell: fork");
|
||||
close(pipefd[0]);
|
||||
close(pipefd[1]);
|
||||
app->last_return_value = 255;
|
||||
ft_errno(FT_EERRNO);
|
||||
}
|
||||
|
||||
/*
|
||||
** return the pid returned by fork. values greater than 0 indicate parentprocess
|
||||
*/
|
||||
static int exec_pid1(t_minishell *app, int pipefd[2], t_cmd *cmd)
|
||||
{
|
||||
int pid1;
|
||||
|
||||
pid1 = fork();
|
||||
if (pid1 < 0)
|
||||
return (fork_failure(app, pipefd), 1);
|
||||
if (pid1 == 0)
|
||||
{
|
||||
dup2(pipefd[1], STDOUT_FILENO);
|
||||
close(pipefd[0]);
|
||||
close(pipefd[1]);
|
||||
cmd_execute(cmd, app);
|
||||
return (pid1);
|
||||
}
|
||||
return (pid1);
|
||||
}
|
||||
|
||||
static int exec_pid2(t_minishell *app, int pipefd[2], t_cmd *cmd)
|
||||
{
|
||||
int pid1;
|
||||
|
||||
pid1 = fork();
|
||||
if (pid1 < 0)
|
||||
return (fork_failure(app, pipefd), 1);
|
||||
if (pid1 == 0)
|
||||
{
|
||||
dup2(pipefd[0], STDIN_FILENO);
|
||||
close(pipefd[0]);
|
||||
close(pipefd[1]);
|
||||
cmd_execute(cmd, app);
|
||||
return (pid1);
|
||||
}
|
||||
return (pid1);
|
||||
}
|
||||
|
||||
t_subprocess connec_pipe_cmd_execute(t_connec_cmd *cmd, t_minishell *app)
|
||||
|
|
@ -54,20 +84,21 @@ t_subprocess connec_pipe_cmd_execute(t_connec_cmd *cmd, t_minishell *app)
|
|||
|
||||
if (do_pipe(pipefd, app) < 0)
|
||||
return (PARENTPROCESS);
|
||||
pid1 = fork();
|
||||
ft_errno(FT_ESUCCESS);
|
||||
pid1 = exec_pid1(app, pipefd, cmd->first);
|
||||
if (pid1 > 0 && ft_errno_get() != FT_ESUCCESS)
|
||||
return (PARENTPROCESS);
|
||||
if (pid1 == 0)
|
||||
{
|
||||
dup_and_close(pipefd[1], STDOUT_FILENO, pipefd);
|
||||
cmd_execute(cmd->first, app);
|
||||
return (SUBPROCESS);
|
||||
}
|
||||
pid2 = fork();
|
||||
ft_errno(FT_ESUCCESS);
|
||||
pid2 = exec_pid2(app, pipefd, cmd->second);
|
||||
if (pid2 > 0 && ft_errno_get() != FT_ESUCCESS)
|
||||
return (PARENTPROCESS);
|
||||
if (pid2 == 0)
|
||||
{
|
||||
dup_and_close(pipefd[0], STDIN_FILENO, pipefd);
|
||||
cmd_execute(cmd->second, app);
|
||||
return (SUBPROCESS);
|
||||
}
|
||||
close_and_wait(app, pid1, pid2, pipefd);
|
||||
close(pipefd[0]);
|
||||
close(pipefd[1]);
|
||||
do_waitpid(app, pid1);
|
||||
do_waitpid(app, pid2);
|
||||
return (PARENTPROCESS);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* connec_pipe_cmd_execute.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/11 11:56:45 by khais #+# #+# */
|
||||
/* Updated: 2025/04/29 15:09:42 by khais ### ########.fr */
|
||||
/* Created: 2025/04/11 11:56:45 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/29 15:09:42 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* group_cmd_execute.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/04 19:50:42 by khais #+# #+# */
|
||||
/* Updated: 2025/04/29 15:11:00 by khais ### ########.fr */
|
||||
/* Created: 2025/04/04 19:50:42 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/30 14:06:24 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -16,6 +16,7 @@
|
|||
#include "../simple_cmd/handle_redirections.h"
|
||||
#include "../simple_cmd/std_fds.h"
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
|
||||
t_subprocess group_cmd_execute(t_group_cmd *cmd, t_minishell *app)
|
||||
{
|
||||
|
|
@ -30,6 +31,12 @@ t_subprocess group_cmd_execute(t_group_cmd *cmd, t_minishell *app)
|
|||
restore_std_fds(&fds);
|
||||
return (SUBPROCESS);
|
||||
}
|
||||
if (pid < 0)
|
||||
{
|
||||
perror("minishell: fork");
|
||||
app->last_return_value = 255;
|
||||
return (PARENTPROCESS);
|
||||
}
|
||||
do_waitpid(app, pid);
|
||||
return (PARENTPROCESS);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* group_cmd_execute.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/04 19:42:36 by khais #+# #+# */
|
||||
/* Updated: 2025/04/29 14:40:03 by khais ### ########.fr */
|
||||
/* Created: 2025/04/04 19:42:36 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/29 14:40:03 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* here_doc.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/03/07 11:42:29 by khais #+# #+# */
|
||||
/* Updated: 2025/04/17 11:51:27 by khais ### ########.fr */
|
||||
/* Created: 2025/03/07 11:42:29 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/29 16:56:08 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -33,9 +33,9 @@ void failed_to_open_tmp_file(void);
|
|||
**
|
||||
** If NULL is given as argument, or marker->word is null, or infd is negative,
|
||||
** or getting a random filename fails, or we are unable to create the file, or
|
||||
** the file already exists, or any other error occurs, return -1.
|
||||
** the file already exists, or any other error occurs, return NULL.
|
||||
*/
|
||||
int here_doc(t_worddesc *marker, int infd, t_minishell *app)
|
||||
char *here_doc(t_worddesc *marker, int infd, t_minishell *app)
|
||||
{
|
||||
int outfd;
|
||||
char *filename;
|
||||
|
|
@ -43,7 +43,7 @@ int here_doc(t_worddesc *marker, int infd, t_minishell *app)
|
|||
|
||||
outfd = setup_here_doc(marker, infd, &filename);
|
||||
if (outfd < 0)
|
||||
return (ft_errno(FT_EHEREDOC_FAILED), failed_to_open_tmp_file(), -1);
|
||||
return (ft_errno(FT_EHEREDOC_FAILED), failed_to_open_tmp_file(), NULL);
|
||||
set_here_doc_mode_sig_handling();
|
||||
line = get_next_line(infd);
|
||||
while (line != NULL)
|
||||
|
|
@ -55,7 +55,8 @@ int here_doc(t_worddesc *marker, int infd, t_minishell *app)
|
|||
line = output_line_and_next(infd, outfd, line);
|
||||
}
|
||||
if (g_signum != 0)
|
||||
return (ft_errno(FT_EHEREDOC_FAILED), interupted(outfd, filename));
|
||||
return (ft_errno(FT_EHEREDOC_FAILED), interupted(outfd, filename),
|
||||
NULL);
|
||||
ft_dprintf(STDERR_FILENO, "minishell: warning: here-document delimited by \
|
||||
end-of-file (wanted `%s')\n", marker->word);
|
||||
return (finalize(outfd, filename));
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* here_doc.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/03/07 11:41:27 by khais #+# #+# */
|
||||
/* Updated: 2025/03/28 15:57:17 by khais ### ########.fr */
|
||||
/* Created: 2025/03/07 11:41:27 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/29 16:38:05 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
# include "../../parser/worddesc/worddesc.h"
|
||||
# include "../../minishell.h"
|
||||
|
||||
int here_doc(t_worddesc *marker, int infd, t_minishell *app);
|
||||
char *here_doc(t_worddesc *marker, int infd, t_minishell *app);
|
||||
char *here_doc_random_filename(void);
|
||||
char *strip_newline(char *str);
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* here_doc_errors.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/03/28 18:29:44 by khais #+# #+# */
|
||||
/* Updated: 2025/03/28 19:03:45 by khais ### ########.fr */
|
||||
/* Created: 2025/03/28 18:29:44 by kcolin #+# #+# */
|
||||
/* Updated: 2025/03/28 19:03:45 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* here_doc_expand_line.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/03/28 16:43:11 by khais #+# #+# */
|
||||
/* Updated: 2025/04/08 16:32:32 by khais ### ########.fr */
|
||||
/* Created: 2025/03/28 16:43:11 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/08 16:32:32 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* here_doc_utils.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/17 11:50:08 by khais #+# #+# */
|
||||
/* Updated: 2025/04/17 11:55:34 by khais ### ########.fr */
|
||||
/* Created: 2025/04/17 11:50:08 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/29 16:39:22 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -50,18 +50,13 @@ char *output_line_and_next(int infd, int outfd, char *line)
|
|||
}
|
||||
|
||||
/*
|
||||
** seek filename to start, unlink filename, and return new outfd
|
||||
** closes outfd, reset correct sig mode handling
|
||||
*/
|
||||
int finalize(int outfd, char *filename)
|
||||
char *finalize(int outfd, char *filename)
|
||||
{
|
||||
close(outfd);
|
||||
outfd = open(filename, O_RDONLY, 0);
|
||||
unlink(filename);
|
||||
free(filename);
|
||||
if (outfd < 0)
|
||||
ft_errno(FT_EERRNO);
|
||||
set_interactive_mode_sig_handling();
|
||||
return (outfd);
|
||||
return (filename);
|
||||
}
|
||||
|
||||
int interupted(int outfd, char *filename)
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* here_doc_utils.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/17 11:49:52 by khais #+# #+# */
|
||||
/* Updated: 2025/04/17 11:53:08 by khais ### ########.fr */
|
||||
/* Created: 2025/04/17 11:49:52 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/29 16:37:56 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
int setup_here_doc(t_worddesc *marker, int infd, char **filename);
|
||||
char *output_line_and_next(int infd, int outfd, char *line);
|
||||
int finalize(int outfd, char *filename);
|
||||
char *finalize(int outfd, char *filename);
|
||||
int interupted(int outfd, char *filename);
|
||||
bool is_marker(char *line, t_worddesc *marker);
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* random_filename.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/03/11 13:29:32 by khais #+# #+# */
|
||||
/* Updated: 2025/03/11 13:30:33 by khais ### ########.fr */
|
||||
/* Created: 2025/03/11 13:29:32 by kcolin #+# #+# */
|
||||
/* Updated: 2025/03/11 13:30:33 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* strip_newline.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/03/11 13:31:22 by khais #+# #+# */
|
||||
/* Updated: 2025/03/11 13:31:31 by khais ### ########.fr */
|
||||
/* Created: 2025/03/11 13:31:22 by kcolin #+# #+# */
|
||||
/* Updated: 2025/03/11 13:31:31 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* builtin_cd.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/03/31 16:20:17 by khais #+# #+# */
|
||||
/* Updated: 2025/04/29 15:41:46 by khais ### ########.fr */
|
||||
/* Created: 2025/03/31 16:20:17 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/29 15:41:46 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* builtin_echo.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/03 13:59:13 by khais #+# #+# */
|
||||
/* Updated: 2025/04/29 15:43:22 by khais ### ########.fr */
|
||||
/* Created: 2025/04/03 13:59:13 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/29 15:43:22 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* builtin_env.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/02 19:35:52 by khais #+# #+# */
|
||||
/* Updated: 2025/04/29 15:40:55 by khais ### ########.fr */
|
||||
/* Created: 2025/04/02 19:35:52 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/29 15:40:55 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* builtin_exit.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/01 18:17:56 by khais #+# #+# */
|
||||
/* Updated: 2025/04/29 15:37:56 by khais ### ########.fr */
|
||||
/* Created: 2025/04/01 18:17:56 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/29 15:37:56 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* builtin_export.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/01 14:00:32 by khais #+# #+# */
|
||||
/* Updated: 2025/04/29 15:41:24 by khais ### ########.fr */
|
||||
/* Created: 2025/04/01 14:00:32 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/29 15:41:24 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* builtin_invalid.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/03/31 14:17:14 by khais #+# #+# */
|
||||
/* Updated: 2025/04/29 15:41:58 by khais ### ########.fr */
|
||||
/* Created: 2025/03/31 14:17:14 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/29 15:41:58 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* builtin_pwd.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/03/31 14:21:52 by khais #+# #+# */
|
||||
/* Updated: 2025/04/29 15:42:51 by khais ### ########.fr */
|
||||
/* Created: 2025/03/31 14:21:52 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/29 15:42:51 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* builtin_unset.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/03 14:35:53 by khais #+# #+# */
|
||||
/* Updated: 2025/04/29 15:40:24 by khais ### ########.fr */
|
||||
/* Created: 2025/04/03 14:35:53 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/29 15:40:24 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* builtins.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/01 16:37:21 by khais #+# #+# */
|
||||
/* Updated: 2025/04/29 15:54:21 by khais ### ########.fr */
|
||||
/* Created: 2025/04/01 16:37:21 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/29 15:54:21 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* builtins.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/03/31 14:16:13 by khais #+# #+# */
|
||||
/* Updated: 2025/04/29 15:46:28 by khais ### ########.fr */
|
||||
/* Created: 2025/03/31 14:16:13 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/29 15:46:28 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* handle_redirections.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/17 11:14:40 by khais #+# #+# */
|
||||
/* Updated: 2025/04/28 12:47:50 by khais ### ########.fr */
|
||||
/* Created: 2025/04/17 11:14:40 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/29 16:55:24 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -29,15 +29,12 @@ static t_redirect *do_redirection(t_redirect *redirection)
|
|||
{
|
||||
int fd;
|
||||
|
||||
fd = open(redirection->redirectee.filename->word,
|
||||
redirection->open_flags, redirection->c_flags);
|
||||
if (redirection->type == FT_HEREDOC)
|
||||
fd = redirection->redirectee.dest;
|
||||
else
|
||||
{
|
||||
fd = open(redirection->redirectee.filename->word,
|
||||
redirection->open_flags, redirection->c_flags);
|
||||
if (fd < 0)
|
||||
return (redirection_error(redirection->redirectee.filename->word));
|
||||
}
|
||||
unlink(redirection->redirectee.filename->word);
|
||||
if (fd < 0)
|
||||
return (redirection_error(redirection->redirectee.filename->word));
|
||||
if (dup2(fd, redirection->source) < 0)
|
||||
return (perror("minishell: dup2"), NULL);
|
||||
close(fd);
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* handle_redirections.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/17 11:14:29 by khais #+# #+# */
|
||||
/* Updated: 2025/04/28 12:45:17 by khais ### ########.fr */
|
||||
/* Created: 2025/04/17 11:14:29 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/28 12:45:17 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* simple_cmd_execute.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/03/27 16:21:56 by khais #+# #+# */
|
||||
/* Updated: 2025/04/29 15:47:27 by khais ### ########.fr */
|
||||
/* Created: 2025/03/27 16:21:56 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/30 15:08:01 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -72,6 +72,13 @@ static t_simple_cmd *post_process_command(t_simple_cmd *cmd, t_minishell *app)
|
|||
return (cmd);
|
||||
}
|
||||
|
||||
static t_subprocess fork_fail(t_minishell *app)
|
||||
{
|
||||
perror("minishell: fork");
|
||||
app->last_return_value = 255;
|
||||
return (PARENTPROCESS);
|
||||
}
|
||||
|
||||
static t_subprocess exec_external_cmd(t_simple_cmd *cmd, t_minishell *app,
|
||||
t_std_fds *fds)
|
||||
{
|
||||
|
|
@ -87,6 +94,8 @@ static t_subprocess exec_external_cmd(t_simple_cmd *cmd, t_minishell *app,
|
|||
if (pid == 0)
|
||||
return (execute_subprocess(exe, cmd, app, fds));
|
||||
free(exe);
|
||||
if (pid < 0)
|
||||
return (fork_fail(app));
|
||||
do_waitpid(app, pid);
|
||||
}
|
||||
restore_std_fds(fds);
|
||||
|
|
@ -105,7 +114,7 @@ t_subprocess simple_cmd_execute(t_simple_cmd *cmd, t_minishell *app)
|
|||
ft_errno(FT_ESUCCESS);
|
||||
if (post_process_command(cmd, app) == NULL)
|
||||
{
|
||||
if (ft_errno_get() != FT_ESUCCESS)
|
||||
if (ft_errno_get() != FT_ESUCCESS && errno != 0)
|
||||
ft_dprintf(STDERR_FILENO, "minishell: post-processing error\n");
|
||||
return (PARENTPROCESS);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* simple_cmd_execute.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/03 14:35:14 by khais #+# #+# */
|
||||
/* Updated: 2025/04/29 15:10:37 by khais ### ########.fr */
|
||||
/* Created: 2025/04/03 14:35:14 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/29 15:10:37 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* simple_cmd_execute_debug.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/10 15:36:26 by khais #+# #+# */
|
||||
/* Updated: 2025/04/29 13:05:49 by khais ### ########.fr */
|
||||
/* Created: 2025/04/10 15:36:26 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/29 13:05:49 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* simple_cmd_execute_debug.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/10 15:36:08 by khais #+# #+# */
|
||||
/* Updated: 2025/04/15 15:34:14 by khais ### ########.fr */
|
||||
/* Created: 2025/04/10 15:36:08 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/15 15:34:14 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* std_fds.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/28 12:44:14 by khais #+# #+# */
|
||||
/* Updated: 2025/04/28 12:45:36 by khais ### ########.fr */
|
||||
/* Created: 2025/04/28 12:44:14 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/28 12:45:36 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* std_fds.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/28 12:42:28 by khais #+# #+# */
|
||||
/* Updated: 2025/04/28 12:45:40 by khais ### ########.fr */
|
||||
/* Created: 2025/04/28 12:42:28 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/28 12:45:40 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* subprocess.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/02 18:19:23 by khais #+# #+# */
|
||||
/* Updated: 2025/04/29 15:14:32 by khais ### ########.fr */
|
||||
/* Created: 2025/04/02 18:19:23 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/29 15:14:32 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* subprocess.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/02 18:17:48 by khais #+# #+# */
|
||||
/* Updated: 2025/04/29 15:14:09 by khais ### ########.fr */
|
||||
/* Created: 2025/04/02 18:17:48 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/29 15:14:09 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
/* +:+ +:+ +:+ */
|
||||
/* By: jguelen <jguelen@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/21 12:40:46 by khais #+# #+# */
|
||||
/* Created: 2025/02/21 12:40:46 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/24 16:49:17 by jguelen ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
/* +:+ +:+ +:+ */
|
||||
/* By: jguelen <jguelen@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/17 11:40:12 by khais #+# #+# */
|
||||
/* Created: 2025/04/17 11:40:12 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/24 16:45:56 by jguelen ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* get_command.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/19 18:03:11 by khais #+# #+# */
|
||||
/* Updated: 2025/04/29 15:04:59 by khais ### ########.fr */
|
||||
/* Created: 2025/02/19 18:03:11 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/29 15:04:59 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* get_command.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/19 18:02:19 by khais #+# #+# */
|
||||
/* Updated: 2025/04/09 13:51:41 by khais ### ########.fr */
|
||||
/* Created: 2025/02/19 18:02:19 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/09 13:51:41 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* minishell.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/29 15:13/45 by khais #+# #+# */
|
||||
/* Updated: 2025/04/29 15:13:45 by khais ### ########.fr */
|
||||
/* Created: 2025/04/29 15:13/45 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/29 15:13:45 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* minishell.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/09 14:02:47 by khais #+# #+# */
|
||||
/* Updated: 2025/04/29 14:30:32 by khais ### ########.fr */
|
||||
/* Created: 2025/04/09 14:02:47 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/30 11:28:11 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* cmd.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/14 17:50:28 by khais #+# #+# */
|
||||
/* Updated: 2025/04/14 17:53:52 by khais ### ########.fr */
|
||||
/* Created: 2025/04/14 17:50:28 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/14 17:53:52 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* cmd.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/14 17:49:55 by khais #+# #+# */
|
||||
/* Updated: 2025/04/14 17:50:20 by khais ### ########.fr */
|
||||
/* Created: 2025/04/14 17:49:55 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/14 17:50:20 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* cmd_debug.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/09 16:53:27 by khais #+# #+# */
|
||||
/* Updated: 2025/04/29 13:05:34 by khais ### ########.fr */
|
||||
/* Created: 2025/04/09 16:53:27 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/29 13:05:34 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* cmd_debug.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/09 16:51:17 by khais #+# #+# */
|
||||
/* Updated: 2025/04/17 12:24:58 by khais ### ########.fr */
|
||||
/* Created: 2025/04/09 16:51:17 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/17 12:24:58 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* cmd_destroy.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/09 16:53:02 by khais #+# #+# */
|
||||
/* Updated: 2025/04/21 10:55:02 by khais ### ########.fr */
|
||||
/* Created: 2025/04/09 16:53:02 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/29 16:40:44 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -23,8 +23,7 @@ void redirect_destroy(t_redirect *redirect)
|
|||
{
|
||||
next = redirect->next;
|
||||
free(redirect->here_doc_eof);
|
||||
if (redirect->type != FT_HEREDOC)
|
||||
worddesc_destroy(redirect->redirectee.filename);
|
||||
worddesc_destroy(redirect->redirectee.filename);
|
||||
free(redirect->unexpanded_filename);
|
||||
free(redirect);
|
||||
redirect = next;
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* cmd_destroy.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/09 16:52:31 by khais #+# #+# */
|
||||
/* Updated: 2025/04/14 15:10:13 by khais ### ########.fr */
|
||||
/* Created: 2025/04/09 16:52:31 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/14 15:10:13 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* cmds_parse.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/16 13:11:33 by khais #+# #+# */
|
||||
/* Updated: 2025/04/16 13:12:15 by khais ### ########.fr */
|
||||
/* Created: 2025/04/16 13:11:33 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/16 13:12:15 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* cmds_parse.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/16 13:11:00 by khais #+# #+# */
|
||||
/* Updated: 2025/04/16 13:11:28 by khais ### ########.fr */
|
||||
/* Created: 2025/04/16 13:11:00 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/16 13:11:28 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* opt_cmds_parse.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/16 13:02:17 by khais #+# #+# */
|
||||
/* Updated: 2025/04/16 13:02:43 by khais ### ########.fr */
|
||||
/* Created: 2025/04/16 13:02:17 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/16 13:02:43 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* opt_cmds_parse.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/16 13:01:50 by khais #+# #+# */
|
||||
/* Updated: 2025/04/16 13:02:11 by khais ### ########.fr */
|
||||
/* Created: 2025/04/16 13:01:50 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/16 13:02:11 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* cmd_parsing.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/03/31 10:28:28 by jguelen #+# #+# */
|
||||
/* Updated: 2025/04/25 13:17:56 by khais ### ########.fr */
|
||||
/* Updated: 2025/04/25 13:17:56 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* cmd_parsing.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/15 10:14:13 by khais #+# #+# */
|
||||
/* Updated: 2025/04/16 15:39:16 by khais ### ########.fr */
|
||||
/* Created: 2025/04/15 10:14:13 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/16 15:39:16 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* connec_cmd_debug.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/09 17:47:18 by khais #+# #+# */
|
||||
/* Updated: 2025/04/29 13:04:50 by khais ### ########.fr */
|
||||
/* Created: 2025/04/09 17:47:18 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/29 13:04:50 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* connec_cmd_debug.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/09 17:46:51 by khais #+# #+# */
|
||||
/* Updated: 2025/04/09 17:48:30 by khais ### ########.fr */
|
||||
/* Created: 2025/04/09 17:46:51 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/09 17:48:30 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* connec_reorient_subtree.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/15 11:37:35 by khais #+# #+# */
|
||||
/* Updated: 2025/04/15 11:39:41 by khais ### ########.fr */
|
||||
/* Created: 2025/04/15 11:37:35 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/15 11:39:41 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* connec_reorient_subtree.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/15 11:37:48 by khais #+# #+# */
|
||||
/* Updated: 2025/04/15 11:40:02 by khais ### ########.fr */
|
||||
/* Created: 2025/04/15 11:37:48 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/15 11:40:02 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* group_cmd_debug.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/09 17:43:56 by khais #+# #+# */
|
||||
/* Updated: 2025/04/29 13:04:58 by khais ### ########.fr */
|
||||
/* Created: 2025/04/09 17:43:56 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/29 13:04:58 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* group_cmd_debug.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/09 17:43:25 by khais #+# #+# */
|
||||
/* Updated: 2025/04/09 17:45:20 by khais ### ########.fr */
|
||||
/* Created: 2025/04/09 17:43:25 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/09 17:45:20 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* group_cmd_parse.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/15 10:46:28 by khais #+# #+# */
|
||||
/* Updated: 2025/04/28 14:26:10 by khais ### ########.fr */
|
||||
/* Created: 2025/04/15 10:46:28 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/28 14:26:10 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* group_cmd_parse.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/15 10:45:49 by khais #+# #+# */
|
||||
/* Updated: 2025/04/16 13:06:53 by khais ### ########.fr */
|
||||
/* Created: 2025/04/15 10:45:49 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/16 13:06:53 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* blank.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/14 15:07:27 by khais #+# #+# */
|
||||
/* Updated: 2025/02/14 15:26:28 by khais ### ########.fr */
|
||||
/* Created: 2025/02/14 15:07:27 by kcolin #+# #+# */
|
||||
/* Updated: 2025/02/14 15:26:28 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* blank.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/14 15:08:36 by khais #+# #+# */
|
||||
/* Updated: 2025/02/14 15:09:02 by khais ### ########.fr */
|
||||
/* Created: 2025/02/14 15:08:36 by kcolin #+# #+# */
|
||||
/* Updated: 2025/02/14 15:09:02 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* identifier.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/19 14:43:57 by khais #+# #+# */
|
||||
/* Updated: 2025/02/19 14:47:00 by khais ### ########.fr */
|
||||
/* Created: 2025/02/19 14:43:57 by kcolin #+# #+# */
|
||||
/* Updated: 2025/02/19 14:47:00 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* identifier.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/19 14:43:09 by khais #+# #+# */
|
||||
/* Updated: 2025/02/19 14:47:01 by khais ### ########.fr */
|
||||
/* Created: 2025/02/19 14:43:09 by kcolin #+# #+# */
|
||||
/* Updated: 2025/02/19 14:47:01 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: kcolin <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/06 15:23:31 by kcolin #+# #+# */
|
||||
/* Updated: 2025/02/11 19:04:03 by khais ### ########.fr */
|
||||
/* Updated: 2025/02/11 19:04:03 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* operator_combo.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/17 16:30:54 by khais #+# #+# */
|
||||
/* Updated: 2025/02/17 16:34:34 by khais ### ########.fr */
|
||||
/* Created: 2025/02/17 16:30:54 by kcolin #+# #+# */
|
||||
/* Updated: 2025/02/17 16:34:34 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* operator_combo.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/17 16:30:29 by khais #+# #+# */
|
||||
/* Updated: 2025/02/17 16:30:45 by khais ### ########.fr */
|
||||
/* Created: 2025/02/17 16:30:29 by kcolin #+# #+# */
|
||||
/* Updated: 2025/02/17 16:30:45 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@
|
|||
/* ::: :::::::: */
|
||||
/* operator_start.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/17 16:21:03 by khais #+# #+# */
|
||||
/* Created: 2025/02/17 16:21:03 by kcolin #+# #+# */
|
||||
/* Updated: 2025/02/18 17:53:13 by jguelen ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* operator_start.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/17 16:22:48 by khais #+# #+# */
|
||||
/* Updated: 2025/02/17 16:23:12 by khais ### ########.fr */
|
||||
/* Created: 2025/02/17 16:22:48 by kcolin #+# #+# */
|
||||
/* Updated: 2025/02/17 16:23:12 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* pipe.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/21 15:04:48 by khais #+# #+# */
|
||||
/* Updated: 2025/02/21 15:06:00 by khais ### ########.fr */
|
||||
/* Created: 2025/02/21 15:04:48 by kcolin #+# #+# */
|
||||
/* Updated: 2025/02/21 15:06:00 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* pipe.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/21 15:03:37 by khais #+# #+# */
|
||||
/* Updated: 2025/02/21 15:04:43 by khais ### ########.fr */
|
||||
/* Created: 2025/02/21 15:03:37 by kcolin #+# #+# */
|
||||
/* Updated: 2025/02/21 15:04:43 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* quote.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/20 13:21:08 by khais #+# #+# */
|
||||
/* Updated: 2025/02/20 13:22:12 by khais ### ########.fr */
|
||||
/* Created: 2025/02/20 13:21:08 by kcolin #+# #+# */
|
||||
/* Updated: 2025/02/20 13:22:12 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* quote.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/20 13:20:46 by khais #+# #+# */
|
||||
/* Updated: 2025/02/20 13:21:28 by khais ### ########.fr */
|
||||
/* Created: 2025/02/20 13:20:46 by kcolin #+# #+# */
|
||||
/* Updated: 2025/02/20 13:21:28 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* optional_pipeline_parse.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/15 10:43:04 by khais #+# #+# */
|
||||
/* Updated: 2025/04/17 11:43:32 by khais ### ########.fr */
|
||||
/* Created: 2025/04/15 10:43:04 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/17 11:43:32 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* optional_pipeline_parse.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/15 10:42:34 by khais #+# #+# */
|
||||
/* Updated: 2025/04/15 14:07:55 by khais ### ########.fr */
|
||||
/* Created: 2025/04/15 10:42:34 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/15 14:07:55 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* pipeline_parse.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/15 11:35:08 by khais #+# #+# */
|
||||
/* Updated: 2025/04/18 09:19:12 by khais ### ########.fr */
|
||||
/* Created: 2025/04/15 11:35:08 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/18 09:19:12 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* pipeline_parse.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/15 11:34:38 by khais #+# #+# */
|
||||
/* Updated: 2025/04/15 14:09:33 by khais ### ########.fr */
|
||||
/* Created: 2025/04/15 11:34:38 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/15 14:09:33 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* redirect.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/14 17:27:53 by khais #+# #+# */
|
||||
/* Updated: 2025/04/22 12:10:31 by khais ### ########.fr */
|
||||
/* Created: 2025/04/14 17:27:53 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/22 12:10:31 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* redirect.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/14 17:27:27 by khais #+# #+# */
|
||||
/* Updated: 2025/04/18 12:55:13 by khais ### ########.fr */
|
||||
/* Created: 2025/04/14 17:27:27 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/18 12:55:13 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* redirect_debug.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/09 15:07:58 by khais #+# #+# */
|
||||
/* Updated: 2025/04/29 13:12:54 by khais ### ########.fr */
|
||||
/* Created: 2025/04/09 15:07:58 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/29 16:49:04 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -37,11 +37,7 @@ static void redirectee_debug(t_redirectee redirectee, t_buffer *leader,
|
|||
indent(leader, is_last);
|
||||
ft_dprintf(STDERR_FILENO, "t_redirectee\n");
|
||||
if (is_here_doc)
|
||||
{
|
||||
indent(leader, false);
|
||||
ft_dprintf(STDERR_FILENO, "dest = %d\n", redirectee.dest);
|
||||
dedent(leader, false);
|
||||
}
|
||||
worddesc_debug(redirectee.filename, leader, true);
|
||||
else
|
||||
worddesc_debug(redirectee.filename, leader, true);
|
||||
dedent(leader, is_last);
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* redirect_debug.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/09 15:06:43 by khais #+# #+# */
|
||||
/* Updated: 2025/04/21 10:33:16 by khais ### ########.fr */
|
||||
/* Created: 2025/04/09 15:06:43 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/21 10:33:16 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* redirect_from_words.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: jguelen <jguelen@student.42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/14 17:31:35 by khais #+# #+# */
|
||||
/* Updated: 2025/04/28 16:50:11 by jguelen ### ########.fr */
|
||||
/* Created: 2025/04/30 10:35/43 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/30 10:35:43 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -61,7 +61,6 @@ static t_redirect *redir_basic_setup(t_worddesc *operator,
|
|||
redir->source = redir_source_from_type(redir->type);
|
||||
redir->open_flags = redir_open_flags_from_type(redir->type);
|
||||
redir->c_flags = 0644;
|
||||
redir->redirectee.dest = -1;
|
||||
return (redir);
|
||||
}
|
||||
|
||||
|
|
@ -72,6 +71,7 @@ t_redirect *redir_from_words(t_worddesc *operator,
|
|||
t_worddesc *spec;
|
||||
|
||||
redir = redir_basic_setup(operator, specifier);
|
||||
worddesc_destroy(operator);
|
||||
if (redir == NULL)
|
||||
return (NULL);
|
||||
if (redir->type == FT_HEREDOC)
|
||||
|
|
@ -79,16 +79,13 @@ t_redirect *redir_from_words(t_worddesc *operator,
|
|||
redir->here_doc_eof = ft_strdup(specifier->word);
|
||||
spec = remove_quotes(specifier);
|
||||
worddesc_destroy(specifier);
|
||||
redir->redirectee.dest = here_doc(spec, STDIN_FILENO, app);
|
||||
redir->redirectee.filename = worddesc_create(
|
||||
here_doc(spec, STDIN_FILENO, app), 0, NULL, WORD_TOKEN);
|
||||
worddesc_destroy(spec);
|
||||
if (redir->redirectee.dest < 0)
|
||||
{
|
||||
ft_errno(FT_EERRNO);
|
||||
return (worddesc_destroy(operator), redirect_destroy(redir), NULL);
|
||||
}
|
||||
if (redir->redirectee.filename == NULL)
|
||||
return (redirect_destroy(redir), ft_errno(FT_EERRNO), NULL);
|
||||
}
|
||||
else
|
||||
redir->redirectee.filename = specifier;
|
||||
worddesc_destroy(operator);
|
||||
return (redir);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* redirect_from_words.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/14 17:31:23 by khais #+# #+# */
|
||||
/* Updated: 2025/04/14 17:32:12 by khais ### ########.fr */
|
||||
/* Created: 2025/04/14 17:31:23 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/14 17:32:12 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* redirect_parse.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/15 10:13:58 by khais #+# #+# */
|
||||
/* Updated: 2025/04/17 11:45:24 by khais ### ########.fr */
|
||||
/* Created: 2025/04/15 10:13:58 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/17 11:45:24 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* redirect_parse.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/15 10:13:28 by khais #+# #+# */
|
||||
/* Updated: 2025/04/15 14:06:36 by khais ### ########.fr */
|
||||
/* Created: 2025/04/15 10:13:28 by kcolin #+# #+# */
|
||||
/* Updated: 2025/04/15 14:06:36 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue