From 3463af82957093bbdfad1ecd83351d49573cf241 Mon Sep 17 00:00:00 2001 From: Maix0 Date: Tue, 30 Apr 2024 21:35:28 +0200 Subject: [PATCH] Update so it works on XeMaix --- Minishell.mk | 8 ++++---- sources/ft_cmd.c | 4 +--- sources/main.c | 7 +------ 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/Minishell.mk b/Minishell.mk index f4ebf28a..d38fa064 100644 --- a/Minishell.mk +++ b/Minishell.mk @@ -6,7 +6,7 @@ # By: maiboyer +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2024/04/28 17:28:30 by maiboyer #+# #+# # -# Updated: 2024/04/30 14:19:46 by maiboyer ### ########.fr # +# Updated: 2024/04/30 21:32:49 by maiboyer ### ########.fr # # # # **************************************************************************** # @@ -63,7 +63,7 @@ bonus: $(OBJ) $(LIB_OBJ) $(OBJDIRNAME)/libme.a $(OBJDIRNAME)/libgmr.a @mkdir -p $(OBJDIRNAME) @mkdir -p $(OBJDIRNAME)/$(LIBDIRNAME) @mkdir -p $(OBJDIRNAME)/$(SRCDIRNAME) - @printf '$(GREY) Be Carefull ur in $(END)$(GREEN)Debug Mode$(END)\n' + @echo -e '$(GREY) Be Carefull ur in $(END)$(GREEN)Debug Mode$(END)' @cc $(CFLAGS) -D DEBUG=42 -o $(NAME) $(OBJ) -L$(OBJDIRNAME) -lgmr -lme # Dependences for all @@ -71,13 +71,13 @@ $(NAME): $(OBJ) $(LIB_OBJ) $(OBJDIRNAME)/libgmr.a $(OBJDIRNAME)/libme.a @mkdir -p $(OBJDIRNAME) @mkdir -p $(OBJDIRNAME)/$(LIBDIRNAME) @mkdir -p $(OBJDIRNAME)/$(SRCDIRNAME) - @echo "$(GREY) Linking $(END)$(GREEN)$(NAME)$(END)" + @echo -e "$(GREY) Linking $(END)$(GREEN)$(NAME)$(END)" @cc $(CFLAGS) -o $(NAME) $(OBJ) $(LIB_OBJ) -L$(OBJDIRNAME) -lgmr -lme # Creating the objects $(OBJDIRNAME)/%.o: %.c @mkdir -p $(dir $@) - @printf '$(GREY) Compiling $(END)$(GREEN)$<$(END)\n' + @echo -e '$(GREY) Compiling $(END)$(GREEN)$<$(END)' @cc $(CFLAGS) -o $@ -c $< -include ${OBJ:.o=.d} diff --git a/sources/ft_cmd.c b/sources/ft_cmd.c index 15401c08..766be78c 100644 --- a/sources/ft_cmd.c +++ b/sources/ft_cmd.c @@ -6,7 +6,7 @@ /* By: rparodi +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/04/13 20:26:13 by rparodi #+# #+# */ -/* Updated: 2024/04/30 15:30:52 by rparodi ### ########.fr */ +/* Updated: 2024/04/30 21:31:27 by maiboyer ### ########.fr */ /* */ /* ************************************************************************** */ @@ -28,11 +28,9 @@ void ft_other_cmd(t_utils *shcat, t_usize i, t_usize prev_i) t_i32 options; t_str *args; t_usize k; - t_usize tmp; // t_str cmd; k = prev_i; - tmp = prev_i; args = (t_str *)malloc(sizeof(t_str) * (i + 2)); while (prev_i < i) { diff --git a/sources/main.c b/sources/main.c index f5a7bb35..37f6ddae 100644 --- a/sources/main.c +++ b/sources/main.c @@ -6,7 +6,7 @@ /* By: rparodi +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/03/28 14:40:38 by rparodi #+# #+# */ -/* Updated: 2024/04/30 16:43:14 by maiboyer ### ########.fr */ +/* Updated: 2024/04/30 21:32:13 by maiboyer ### ########.fr */ /* */ /* ************************************************************************** */ @@ -73,9 +73,7 @@ void exec_shcat(t_utils *shcat) void ft_take_args(t_utils *shcat) { - t_i32 i; - i = 0; while (1) { shcat->str_input = readline((t_const_str)shcat->name_shell); @@ -85,17 +83,14 @@ void ft_take_args(t_utils *shcat) exec_shcat(shcat); add_history(shcat->str_input); free(shcat->str_input); - i++; } } void ft_find_path(t_str arge[], t_utils *utils) { t_i32 i; - t_u8 check; i = 0; - check = 0; while (arge[i] != NULL) { if (arge[i][0] == 'P' && arge[i][1] == 'A' && arge[i][2] == 'T' &&