Update so it works on XeMaix

This commit is contained in:
Maix0 2024-04-30 21:35:28 +02:00
parent c81cd0c2ea
commit 3463af8295
3 changed files with 6 additions and 13 deletions

View file

@ -6,7 +6,7 @@
# By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ # # By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ # # +#+#+#+#+#+ +#+ #
# Created: 2024/04/28 17:28:30 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)
@mkdir -p $(OBJDIRNAME)/$(LIBDIRNAME) @mkdir -p $(OBJDIRNAME)/$(LIBDIRNAME)
@mkdir -p $(OBJDIRNAME)/$(SRCDIRNAME) @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 @cc $(CFLAGS) -D DEBUG=42 -o $(NAME) $(OBJ) -L$(OBJDIRNAME) -lgmr -lme
# Dependences for all # Dependences for all
@ -71,13 +71,13 @@ $(NAME): $(OBJ) $(LIB_OBJ) $(OBJDIRNAME)/libgmr.a $(OBJDIRNAME)/libme.a
@mkdir -p $(OBJDIRNAME) @mkdir -p $(OBJDIRNAME)
@mkdir -p $(OBJDIRNAME)/$(LIBDIRNAME) @mkdir -p $(OBJDIRNAME)/$(LIBDIRNAME)
@mkdir -p $(OBJDIRNAME)/$(SRCDIRNAME) @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 @cc $(CFLAGS) -o $(NAME) $(OBJ) $(LIB_OBJ) -L$(OBJDIRNAME) -lgmr -lme
# Creating the objects # Creating the objects
$(OBJDIRNAME)/%.o: %.c $(OBJDIRNAME)/%.o: %.c
@mkdir -p $(dir $@) @mkdir -p $(dir $@)
@printf '$(GREY) Compiling $(END)$(GREEN)$<$(END)\n' @echo -e '$(GREY) Compiling $(END)$(GREEN)$<$(END)'
@cc $(CFLAGS) -o $@ -c $< @cc $(CFLAGS) -o $@ -c $<
-include ${OBJ:.o=.d} -include ${OBJ:.o=.d}

View file

@ -6,7 +6,7 @@
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */ /* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/13 20:26:13 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_i32 options;
t_str *args; t_str *args;
t_usize k; t_usize k;
t_usize tmp;
// t_str cmd; // t_str cmd;
k = prev_i; k = prev_i;
tmp = prev_i;
args = (t_str *)malloc(sizeof(t_str) * (i + 2)); args = (t_str *)malloc(sizeof(t_str) * (i + 2));
while (prev_i < i) while (prev_i < i)
{ {

View file

@ -6,7 +6,7 @@
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */ /* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/28 14:40:38 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) void ft_take_args(t_utils *shcat)
{ {
t_i32 i;
i = 0;
while (1) while (1)
{ {
shcat->str_input = readline((t_const_str)shcat->name_shell); shcat->str_input = readline((t_const_str)shcat->name_shell);
@ -85,17 +83,14 @@ void ft_take_args(t_utils *shcat)
exec_shcat(shcat); exec_shcat(shcat);
add_history(shcat->str_input); add_history(shcat->str_input);
free(shcat->str_input); free(shcat->str_input);
i++;
} }
} }
void ft_find_path(t_str arge[], t_utils *utils) void ft_find_path(t_str arge[], t_utils *utils)
{ {
t_i32 i; t_i32 i;
t_u8 check;
i = 0; i = 0;
check = 0;
while (arge[i] != NULL) while (arge[i] != NULL)
{ {
if (arge[i][0] == 'P' && arge[i][1] == 'A' && arge[i][2] == 'T' && if (arge[i][0] == 'P' && arge[i][1] == 'A' && arge[i][2] == 'T' &&