redirections, empty command, parse errors++

This commit is contained in:
mcolonna 2024-04-30 14:34:15 +02:00
parent 8d9ed896a2
commit d7b4631701
5 changed files with 118 additions and 30 deletions

View file

@ -6,7 +6,7 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/23 14:15:12 by mcolonna #+# #+# */
/* Updated: 2024/04/29 15:56:26 by mcolonna ### ########.fr */
/* Updated: 2024/04/30 15:00:48 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -47,6 +47,7 @@ typedef struct s_call
typedef struct s_command
{
int error; // 0 if parse_command() succeded, error status if not
bool empty; // true if there isn't anything to do
const t_call *calls; // all calls to programs (ended by .program == NULL)
int input_fd; // fd to use with '<' redirection (0 by default)
int output_fd; // fd to use with '>' redirection (1 by default)
@ -71,6 +72,9 @@ void minishell_error(const char *msg);
// Call perror() and exit the program.
void fatal_error(const char *msg);
// Call strerror() and exit the program.
void fatal_error_msg(const char *msg);
///// PATH /////
// Get the PATH values.