minishell/src/parser/parser_alloc_command.c
2025-03-04 16:04:10 +01:00

30 lines
1.2 KiB
C

/* ************************************************************************** */
/* */
/* :::::::: */
/* parser_alloc_command.c :+: :+: */
/* +:+ */
/* By: qmennen <qmennen@student.codam.nl> +#+ */
/* +#+ */
/* Created: 2025/02/11 16:18:21 by qmennen #+# #+# */
/* Updated: 2025/03/04 15:41:59 by whaffman ######## odam.nl */
/* */
/* ************************************************************************** */
#include "minishell.h"
t_command *parser_alloc_command(t_minishell *msh, char *cmd)
{
t_command *command;
command = malloc_safe(msh, sizeof(t_command));
command->args = NULL;
command->fd_in = 0;
command->fd_out = 1;
command->redirect_in = NULL;
command->redirect_out = NULL;
// command->environment = NULL;
command->n_fds = 0;
command->command = cmd;
return (command);
}