diff --git a/Makefile b/Makefile index c97bdba..2456888 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ UTILS_SRC = utils/ft_is_in_quote.c utils/ft_strncpy.c utils/ft_strreplace.c utils/ft_strnchr.c utils/ft_split_quoted.c utils/ft_strshift.c utils/ft_quote_remover.c utils/ft_str_is_empty.c utils/ft_atoi_check.c -SRCS = ${UTILS_SRC} main.c file.c infile.c outfile.c heredoc.c syntatics.c cmd.c cmds.c env.c env2.c env3.c execution.c spacer.c env_fill.c builtins/echo.c builtins/pwd.c builtins/export.c builtins/env.c builtins/cd.c builtins/exit.c builtins/unset.c +SRCS = ${UTILS_SRC} main.c file.c infile.c outfile.c heredoc.c syntatics.c cmd.c cmds.c env.c env2.c env3.c execution.c spacer.c env_fill.c builtins/echo.c builtins/pwd.c builtins/export.c builtins/env.c builtins/cd.c builtins/exit.c OBJS = ${SRCS:.c=.o} diff --git a/env3.c b/env3.c index d7f2ec0..9f6f56b 100644 --- a/env3.c +++ b/env3.c @@ -6,7 +6,7 @@ /* By: erey-bet +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/02/17 17:25:09 by erey-bet #+# #+# */ -/* Updated: 2023/02/23 15:46:46 by erey-bet ### ########.fr */ +/* Updated: 2023/02/28 12:46:33 by erey-bet ### ########.fr */ /* */ /* ************************************************************************** */ @@ -86,13 +86,13 @@ int delete_by_key(char *key, t_list **head) int possible_key(char *key) { - int i; + int i; i = -1; - if (ft_isdigit(key[i + 1]) || key[i + 1] == '@') + if (ft_isdigit(key[i + 1])) return (0); while (key[++i]) - if (!ft_isalnum(key[i]) && key[i] != '_' && key[i] != '#' && key[i] != '@') + if (!ft_isalnum(key[i]) && key[i] != '_') return (0); return (1); } diff --git a/execution.c b/execution.c index 0e61b42..f066141 100644 --- a/execution.c +++ b/execution.c @@ -6,7 +6,7 @@ /* By: cchauvet executable, "export") == 0) return_code = (export(data->env,cmd->args + 1, cmd->fd_out)); else if (ft_strcmp(cmd->executable, "cd") == 0) - return_code = (move_folder(cmd->args[1], cmd->fd_out)); + return_code = (move_folder(cmd->args + 1, cmd->fd_out)); if (ft_strcmp(cmd->executable, "unset") == 0) return_code = (unset(data->env, cmd->args, cmd->fd_out)); else if (ft_strcmp(cmd->executable, "echo") == 0) diff --git a/minishell.h b/minishell.h index 9fd16a3..7953596 100644 --- a/minishell.h +++ b/minishell.h @@ -6,7 +6,7 @@ /* By: cchauvet