fix + norm
This commit is contained in:
4
Makefile
4
Makefile
@@ -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)
|
||||
|
||||
@@ -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
1
srcs/env/var.c
vendored
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user