fix + norm

This commit is contained in:
Loic Deridder
2025-02-15 09:28:53 +01:00
parent 785e3fdfa0
commit bc2386cc83
9 changed files with 11 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
CC = gcc
CC = cc
WFLAGS = -Wall -Werror -Wextra -g -g3 -ggdb
LINK = -lreadline
@@ -29,7 +29,7 @@ $(LIBFT): $(LIBFT_SRCS)
$(OBJDIR)/%.o: $(SRCDIR)/%.c
@mkdir -p $(dir $@)
@$(CC) $(WFLAGS) -gdwarf-4 -MMD -MP -I$(INCDIR) -D DIO_PATH="\"$(HOME)/ast.xml\"" -c $< -o $@ $(LINK)
@$(CC) $(WFLAGS) -gdwarf-4 -MMD -MP -I$(INCDIR) -D DIO_PATH="\"$(HOME)/ast.xml\"" -c $< -o $@
$(NAME): $(LIBFT) $(OBJS)
@$(CC) $(WFLAGS) -gdwarf-4 $(OBJS) $(LIBFT) -D DIO_PATH="\"$(HOME)/ast.xml\"" -o $(NAME) $(LINK)

View File

@@ -23,6 +23,7 @@ static char *add_arg(char c, char *str, va_list args)
{
char *out;
out = NULL;
if (c == 'c')
out = ft_strfjoinc(str, va_arg(args, int));
else if (c == 's')

1
srcs/env/var.c vendored
View File

@@ -80,6 +80,7 @@ bool is_valid_key(char *key, t_msh *msh)
char *tmp;
int i;
i = 0;
tmp = ft_strjoin(key, "=");
if (!tmp)
return (false);

View File

@@ -92,11 +92,9 @@ int ifhere_remove_quote(t_ast_n *node, int j)
void read_input(t_ast_n *node, int j)
{
char *str;
// int len;
int check;
check = ifhere_remove_quote(node, j);
// len = ft_strlen(node->files[j]);
str = get_next_line(node->msh->here_fd, 0);
while (str && ft_strncmp(str, node->files[j], ft_strlen(str) - 1) != 0)
{

View File

@@ -16,6 +16,7 @@ int handle_file(t_ast_n *node, int check, int i)
{
int fd;
fd = 0;
if (check == 1 && access(node->files[i], F_OK))
{
ft_fprintf(2, "%s: %s\n", node->files[i], "No such file or directory");

View File

@@ -6,7 +6,7 @@
/* By: lderidde <lderidde@student.s19.be> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/12 09:57:39 by lderidde #+# #+# */
/* Updated: 2025/02/12 13:30:44 by lderidde ### ########.fr */
/* Updated: 2025/02/15 09:22:23 by lderidde ### ########.fr */
/* */
/* ************************************************************************** */
@@ -68,6 +68,7 @@ char *execextract_env(char *str, char **envp)
char *tmp;
i = 1;
tmp = NULL;
while (str[i] && execis_validchar(str[i]))
i++;
if (i > 1)

View File

@@ -35,6 +35,7 @@ static char *extract_env(char *str, char **envp)
char *tmp;
i = 1;
tmp = NULL;
while (str[i] && is_exvalidchar(str[i]))
i++;
if (i > 1)

View File

@@ -3,10 +3,10 @@
/* ::: :::::::: */
/* heredoc.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: nalebrun <nalebrun@student.s19.be> +#+ +:+ +#+ */
/* By: lderidde <lderidde@student.s19.be> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/11 09:01:14 by lderidde #+# #+# */
/* Updated: 2025/02/11 16:31:50 by nalebrun ### ########.fr */
/* Updated: 2025/02/15 09:28:28 by lderidde ### ########.fr */
/* */
/* ************************************************************************** */
@@ -14,7 +14,6 @@
static void remove_quote(char **new, char *limiter, char c)
{
// char *new;
int i;
int k;
int len;
@@ -33,8 +32,6 @@ static void remove_quote(char **new, char *limiter, char c)
else
(*new)[i++] = limiter[k++];
}
// ft_free(str);
// *str = new;
}
static int ifremove_quote(char **new, char *limiter)

View File

@@ -6,7 +6,7 @@
/* By: lderidde <lderidde@student.s19.be> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/12 13:41:03 by lderidde #+# #+# */
/* Updated: 2025/02/12 13:41:03 by lderidde ### ########.fr */
/* Updated: 2025/02/15 09:25:49 by lderidde ### ########.fr */
/* */
/* ************************************************************************** */