fix: args have now a env var replacement ex: 0 -> 0

This commit is contained in:
Camille Chauvet 2023-03-10 13:40:20 +01:00
parent 087a96e54b
commit 69fc4c573a
5 changed files with 2 additions and 10 deletions

Binary file not shown.

View File

@ -24,7 +24,7 @@ SRCS = ${BUILTINS_SRC} \
./redirection/infile.c \ ./redirection/infile.c \
./redirection/outfile.c \ ./redirection/outfile.c \
./redirection/file.c \ ./redirection/file.c \
./parse/cmds_parse.c ./parse/parse.c
OBJS = ${SRCS:.c=.o} OBJS = ${SRCS:.c=.o}

View File

@ -1,12 +1,5 @@
#include "./data_private.h" #include "./data_private.h"
int *ft_get_exit_code(void)
{
static int exit_code = 0;
return (&exit_code);
}
int ft_gen_exit_code(t_data *data) int ft_gen_exit_code(t_data *data)
{ {
char *str; char *str;

View File

@ -10,7 +10,6 @@ typedef struct s_data
char *exit_code_str; char *exit_code_str;
} t_data; } t_data;
int *ft_get_exit_code();
int ft_gen_exit_code(t_data *data); int ft_gen_exit_code(t_data *data);
#endif #endif

View File

@ -31,7 +31,7 @@ int ft_args_parse(t_data *data, char *cmd_str, t_cmd *cmd)
if (tab == NULL) if (tab == NULL)
return (1); return (1);
i = 0; i = 0;
while (tab[i] == NULL) while (tab[i] != NULL)
{ {
str = ft_env_filler(data, tab[i]); str = ft_env_filler(data, tab[i]);
if (str == NULL) if (str == NULL)