Skip to content

Commit

Permalink
export ameliore
Browse files Browse the repository at this point in the history
  • Loading branch information
Chloe AUBRY committed Oct 3, 2022
1 parent 5352c2c commit 0755447
Show file tree
Hide file tree
Showing 157 changed files with 547 additions and 102 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ SRCS_FILES = srcs/minishell/minishell.c \
srcs/executor/builtin/pwd/pwd.c \
srcs/executor/builtin/cd/cd.c \
srcs/executor/builtin/export/export.c \
srcs/executor/builtin/export/export_utils.c \
srcs/executor/builtin/unset/unset.c \
srcs/executor/builtin/exit/exit.c

Expand Down
72 changes: 62 additions & 10 deletions includes/minishell_fonctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: caubry <caubry@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/09/02 20:42:53 by ychibani #+# #+# */
/* Updated: 2022/10/03 14:12:27 by caubry ### ########.fr */
/* Updated: 2022/10/03 21:07:33 by caubry ### ########.fr */
/* */
/* ************************************************************************** */

Expand All @@ -27,26 +27,78 @@ void __init_structs(t_program_data *data, t_user_input *ui,
*/

int change_directory(char *path);
void ft_cd(t_user_input *ui);

/*
** echo
*/

void ft_echo(t_user_input *ui);
int ft_cmd(t_user_input *ui);
char *remove_quote(char *str);

/*
** env
*/

void ft_env(t_user_input *ui);
void ft_pwd(void);
void ft_cd(t_user_input *ui);
void ft_export(t_user_input *ui, char *to_set);
void ft_unset(t_user_input *ui);
void ft_free(char **to_free, int i);
void ft_exit(t_user_input *ui);
t_env *ft_init_env(char *var_to_split);
t_env **ft_split_env(char **env);

/*
** env_utils
*/

void __env_clear(t_env **lst, void (*del)(void*));
int ft_var_length(char *var);
char *__strncpy(char *dst, const char *src, size_t dstsize);
t_env *__lst_env_new(char *name, char *value, int appear);
void __env_lstadd_back(t_env **alst, t_env *new);
t_env *ft_init_env(char *var_to_split);
int ft_size(char **str);


/*
** exit
*/

void ft_exit(t_user_input *ui);

/*
** export
*/

void ft_choose_export(t_user_input *ui);
void ft_export_arg(t_user_input *ui, char *var);
void ft_export_no_arg(t_user_input *ui);
void ft_make_export(t_env *search, char *to_set, t_user_input *ui);
void ft_changevar(t_env *env, char *var_to_split);

/*
** export_utils
*/

void ft_free(char **to_free, int i);
int ft_var_length(char *var);
int ft_valid_var(char *str);
void ft_concat_var(t_env *env, char *var_to_split);


/*
** pwd
*/

void ft_pwd(void);

/*
** unset
*/

void ft_unset(t_user_input *ui);

/*
** exec
*/

int ft_cmd(t_user_input *ui);


/*
** Tokenizer Utils
Expand Down
4 changes: 3 additions & 1 deletion includes/minishell_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: caubry <caubry@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/09/10 16:28:32 by ychibani #+# #+# */
/* Updated: 2022/10/03 13:59:43 by caubry ### ########.fr */
/* Updated: 2022/10/03 20:02:28 by caubry ### ########.fr */
/* */
/* ************************************************************************** */

Expand All @@ -23,6 +23,8 @@ typedef struct s_env
{
char *name;
char *value;
int env;
int order;
struct s_env *next;
} t_env;

Expand Down
3 changes: 3 additions & 0 deletions libft/char/ft_isalnum.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
char/ft_isalnum.o: char/ft_isalnum.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/char/ft_isalnum.o
Binary file not shown.
1 change: 1 addition & 0 deletions libft/char/ft_isalpha.d
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
char/ft_isalpha.o: char/ft_isalpha.c
Binary file added libft/char/ft_isalpha.o
Binary file not shown.
1 change: 1 addition & 0 deletions libft/char/ft_isascii.d
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
char/ft_isascii.o: char/ft_isascii.c
Binary file added libft/char/ft_isascii.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/char/ft_isdigit.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
char/ft_isdigit.o: char/ft_isdigit.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/char/ft_isdigit.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/char/ft_isprint.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
char/ft_isprint.o: char/ft_isprint.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/char/ft_isprint.o
Binary file not shown.
1 change: 1 addition & 0 deletions libft/char/ft_tolower.d
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
char/ft_tolower.o: char/ft_tolower.c
Binary file added libft/char/ft_tolower.o
Binary file not shown.
1 change: 1 addition & 0 deletions libft/char/ft_toupper.d
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
char/ft_toupper.o: char/ft_toupper.c
Binary file added libft/char/ft_toupper.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/fd/ft_putchar_fd.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fd/ft_putchar_fd.o: fd/ft_putchar_fd.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/fd/ft_putchar_fd.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/fd/ft_putendl_fd.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fd/ft_putendl_fd.o: fd/ft_putendl_fd.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/fd/ft_putendl_fd.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/fd/ft_putnbr_fd.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fd/ft_putnbr_fd.o: fd/ft_putnbr_fd.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/fd/ft_putnbr_fd.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/fd/ft_putstr_fd.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fd/ft_putstr_fd.o: fd/ft_putstr_fd.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/fd/ft_putstr_fd.o
Binary file not shown.
2 changes: 2 additions & 0 deletions libft/fd/gnl.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fd/gnl.o: fd/gnl.c includes/libft.h includes/libft_defines.h \
includes/libft_structs.h includes/libft_fonctions.h
Binary file added libft/fd/gnl.o
Binary file not shown.
Binary file added libft/libft.a
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/lists/ft_lstadd_back.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
lists/ft_lstadd_back.o: lists/ft_lstadd_back.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/lists/ft_lstadd_back.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/lists/ft_lstadd_front.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
lists/ft_lstadd_front.o: lists/ft_lstadd_front.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/lists/ft_lstadd_front.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/lists/ft_lstclear.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
lists/ft_lstclear.o: lists/ft_lstclear.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/lists/ft_lstclear.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/lists/ft_lstdelone.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
lists/ft_lstdelone.o: lists/ft_lstdelone.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/lists/ft_lstdelone.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/lists/ft_lstiter.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
lists/ft_lstiter.o: lists/ft_lstiter.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/lists/ft_lstiter.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/lists/ft_lstlast.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
lists/ft_lstlast.o: lists/ft_lstlast.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/lists/ft_lstlast.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/lists/ft_lstmap.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
lists/ft_lstmap.o: lists/ft_lstmap.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/lists/ft_lstmap.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/lists/ft_lstnew.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
lists/ft_lstnew.o: lists/ft_lstnew.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/lists/ft_lstnew.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/lists/ft_lstsize.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
lists/ft_lstsize.o: lists/ft_lstsize.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/lists/ft_lstsize.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/memory/ft_calloc.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
memory/ft_calloc.o: memory/ft_calloc.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/memory/ft_calloc.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/memory/ft_memchr.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
memory/ft_memchr.o: memory/ft_memchr.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/memory/ft_memchr.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/memory/ft_memcmp.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
memory/ft_memcmp.o: memory/ft_memcmp.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/memory/ft_memcmp.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/memory/ft_memcpy.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
memory/ft_memcpy.o: memory/ft_memcpy.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/memory/ft_memcpy.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/memory/ft_memmove.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
memory/ft_memmove.o: memory/ft_memmove.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/memory/ft_memmove.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/memory/ft_memset.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
memory/ft_memset.o: memory/ft_memset.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/memory/ft_memset.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/printf/ft_conv_fct.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
printf/ft_conv_fct.o: printf/ft_conv_fct.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/printf/ft_conv_fct.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/printf/ft_printf.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
printf/ft_printf.o: printf/ft_printf.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/printf/ft_printf.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/printf/ft_treat_format.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
printf/ft_treat_format.o: printf/ft_treat_format.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/printf/ft_treat_format.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/stdlib/ft_atoi.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
stdlib/ft_atoi.o: stdlib/ft_atoi.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/stdlib/ft_atoi.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/stdlib/ft_itoa.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
stdlib/ft_itoa.o: stdlib/ft_itoa.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/stdlib/ft_itoa.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/string/ft_bzero.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
string/ft_bzero.o: string/ft_bzero.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/string/ft_bzero.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/string/ft_split.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
string/ft_split.o: string/ft_split.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/string/ft_split.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/string/ft_strchr.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
string/ft_strchr.o: string/ft_strchr.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/string/ft_strchr.o
Binary file not shown.
1 change: 1 addition & 0 deletions libft/string/ft_strcmp.d
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
string/ft_strcmp.o: string/ft_strcmp.c
Binary file added libft/string/ft_strcmp.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/string/ft_strdup.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
string/ft_strdup.o: string/ft_strdup.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/string/ft_strdup.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/string/ft_striteri.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
string/ft_striteri.o: string/ft_striteri.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/string/ft_striteri.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/string/ft_strjoin.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
string/ft_strjoin.o: string/ft_strjoin.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/string/ft_strjoin.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/string/ft_strlcat.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
string/ft_strlcat.o: string/ft_strlcat.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/string/ft_strlcat.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/string/ft_strlcpy.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
string/ft_strlcpy.o: string/ft_strlcpy.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/string/ft_strlcpy.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/string/ft_strlen.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
string/ft_strlen.o: string/ft_strlen.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/string/ft_strlen.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/string/ft_strmapi.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
string/ft_strmapi.o: string/ft_strmapi.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/string/ft_strmapi.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/string/ft_strncmp.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
string/ft_strncmp.o: string/ft_strncmp.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/string/ft_strncmp.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/string/ft_strnstr.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
string/ft_strnstr.o: string/ft_strnstr.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/string/ft_strnstr.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/string/ft_strrchr.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
string/ft_strrchr.o: string/ft_strrchr.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/string/ft_strrchr.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/string/ft_strtrim.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
string/ft_strtrim.o: string/ft_strtrim.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/string/ft_strtrim.o
Binary file not shown.
3 changes: 3 additions & 0 deletions libft/string/ft_substr.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
string/ft_substr.o: string/ft_substr.c includes/libft.h \
includes/libft_defines.h includes/libft_structs.h \
includes/libft_fonctions.h
Binary file added libft/string/ft_substr.o
Binary file not shown.
Binary file added minishell
Binary file not shown.
5 changes: 5 additions & 0 deletions srcs/clean/clean_exit.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
srcs/clean/clean_exit.o: srcs/clean/clean_exit.c includes/minishell.h \
libft/includes/libft.h libft/includes/libft_defines.h \
libft/includes/libft_structs.h libft/includes/libft_fonctions.h \
includes/minishell_enums.h includes/minishell_defines.h \
includes/minishell_structs.h includes/minishell_fonctions.h
Binary file added srcs/clean/clean_exit.o
Binary file not shown.
5 changes: 5 additions & 0 deletions srcs/clean/cleaner_prog.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
srcs/clean/cleaner_prog.o: srcs/clean/cleaner_prog.c includes/minishell.h \
libft/includes/libft.h libft/includes/libft_defines.h \
libft/includes/libft_structs.h libft/includes/libft_fonctions.h \
includes/minishell_enums.h includes/minishell_defines.h \
includes/minishell_structs.h includes/minishell_fonctions.h
Binary file added srcs/clean/cleaner_prog.o
Binary file not shown.
6 changes: 3 additions & 3 deletions srcs/executor/builtin/cd/cd.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: caubry <caubry@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/09/28 15:21:14 by caubry #+# #+# */
/* Updated: 2022/09/28 16:01:27 by caubry ### ########.fr */
/* Updated: 2022/10/03 19:21:00 by caubry ### ########.fr */
/* */
/* ************************************************************************** */

Expand All @@ -32,7 +32,7 @@ void ft_cd(t_user_input *ui)
test = getcwd(NULL, 0);
oldpwd = _strjoin(__strdup("oldpwd="), test);
free(test);
ft_export(ui, oldpwd);
ft_export_arg(ui, oldpwd);
if (!path)
chdir(getenv("HOME"));
else
Expand All @@ -45,7 +45,7 @@ void ft_cd(t_user_input *ui)
}
test = getcwd(NULL, 0);
pwd = _strjoin(__strdup("pwd="), test);
ft_export(ui, pwd);
ft_export_arg(ui, pwd);
free(test);
free(pwd);
free(oldpwd);
Expand Down
6 changes: 6 additions & 0 deletions srcs/executor/builtin/cd/cd.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
srcs/executor/builtin/cd/cd.o: srcs/executor/builtin/cd/cd.c \
includes/minishell.h libft/includes/libft.h \
libft/includes/libft_defines.h libft/includes/libft_structs.h \
libft/includes/libft_fonctions.h includes/minishell_enums.h \
includes/minishell_defines.h includes/minishell_structs.h \
includes/minishell_fonctions.h
Binary file added srcs/executor/builtin/cd/cd.o
Binary file not shown.
9 changes: 8 additions & 1 deletion srcs/executor/builtin/echo/echo.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: caubry <caubry@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/09/27 10:36:31 by caubry #+# #+# */
/* Updated: 2022/09/29 10:31:25 by caubry ### ########.fr */
/* Updated: 2022/10/03 18:33:04 by caubry ### ########.fr */
/* */
/* ************************************************************************** */

Expand All @@ -18,7 +18,9 @@ int check_quote(char *str, int i, char *quote)
&& (*quote == 0 || *quote == str[i]))
{
if (*quote == 0)
{
*quote = str[i];
}
else
*quote = 0;
i++;
Expand Down Expand Up @@ -48,6 +50,11 @@ char *remove_quote(char *str)
j++;
i++;
}
if (str[i] && str[i] == quote)
{
quote = 0;
i++;
}
}
no_quote[j] = '\0';
free (str);
Expand Down
6 changes: 6 additions & 0 deletions srcs/executor/builtin/echo/echo.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
srcs/executor/builtin/echo/echo.o: srcs/executor/builtin/echo/echo.c \
includes/minishell.h libft/includes/libft.h \
libft/includes/libft_defines.h libft/includes/libft_structs.h \
libft/includes/libft_fonctions.h includes/minishell_enums.h \
includes/minishell_defines.h includes/minishell_structs.h \
includes/minishell_fonctions.h
Binary file added srcs/executor/builtin/echo/echo.o
Binary file not shown.
Loading

0 comments on commit 0755447

Please sign in to comment.