From ef3a07b2f390c7a50c945e6aa92868adbe6c6517 Mon Sep 17 00:00:00 2001 From: gazhonsepaskwa Date: Tue, 11 Feb 2025 14:53:24 +0100 Subject: [PATCH] stoped putting file arount the system --- Makefile | 4 ++-- includes/minishell.h | 6 +++++- srcs/parsing/parser.c | 2 +- srcs/powerline.c | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 5d51782..e128da0 100644 --- a/Makefile +++ b/Makefile @@ -26,10 +26,10 @@ $(LIBFT): $(OBJDIR)/%.o: $(SRCDIR)/%.c @mkdir -p $(dir $@) - @$(CC) $(WFLAGS) -MMD -MP -I$(INCDIR) -c $< -o $@ $(LINK) + @$(CC) $(WFLAGS) -MMD -MP -I$(INCDIR) -D DIO_PATH="\"$(HOME)/ast.xml\"" -c $< -o $@ $(LINK) $(NAME): $(LIBFT) $(OBJS) - @$(CC) $(WFLAGS) $(OBJS) $(LIBFT) -o $(NAME) $(LINK) + @$(CC) $(WFLAGS) $(OBJS) $(LIBFT) -D DIO_PATH="\"$(HOME)/ast.xml\"" -o $(NAME) $(LINK) @echo "$(CYAN)Build completed: $(NAME)$(RESET)" clean: diff --git a/includes/minishell.h b/includes/minishell.h index fac1176..db4a5ce 100644 --- a/includes/minishell.h +++ b/includes/minishell.h @@ -13,7 +13,11 @@ #ifndef MINISHELL_H # define MINISHELL_H -# define DEBUG 0 +# define DEBUG 1 + +# ifndef DIO_PATH +# define DIO_PATH "ast.xml" +# endif typedef struct s_ast_n t_ast_n; typedef struct s_node t_node; diff --git a/srcs/parsing/parser.c b/srcs/parsing/parser.c index 87e8f4e..b7cb154 100644 --- a/srcs/parsing/parser.c +++ b/srcs/parsing/parser.c @@ -49,7 +49,7 @@ t_ast_n *parser(char *input, t_msh *msh) create_heredoc(lst); if (DEBUG) { - dio = drawio_init("ast.xml"); + dio = drawio_init(DIO_PATH); gen_dio_linked_list(lst, dio); } ast = get_ast(msh, lst); diff --git a/srcs/powerline.c b/srcs/powerline.c index 21eca2a..cccb88e 100644 --- a/srcs/powerline.c +++ b/srcs/powerline.c @@ -33,7 +33,7 @@ char *get_pwd() return (ft_strdup("")); pwd_base = pwd; cpy = pwd; - if (ft_strncmp(pwd, "/home", 5) == 0) + if (ft_strncmp(pwd, "/home/", 6) == 0) { pwd += 6; while (pwd && *pwd && (*pwd) != '/')