ASTERIX IL SUCE IDEFIX DANS LES CHIOTTES

This commit is contained in:
Etienne Rey-bethbeder 2023-02-28 13:16:10 +01:00
parent ca18dd4205
commit ed546f5a8d
4 changed files with 9 additions and 9 deletions

View File

@ -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 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} OBJS = ${SRCS:.c=.o}

8
env3.c
View File

@ -6,7 +6,7 @@
/* By: erey-bet <marvin@42.fr> +#+ +:+ +#+ */ /* By: erey-bet <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2023/02/17 17:25:09 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 possible_key(char *key)
{ {
int i; int i;
i = -1; i = -1;
if (ft_isdigit(key[i + 1]) || key[i + 1] == '@') if (ft_isdigit(key[i + 1]))
return (0); return (0);
while (key[++i]) while (key[++i])
if (!ft_isalnum(key[i]) && key[i] != '_' && key[i] != '#' && key[i] != '@') if (!ft_isalnum(key[i]) && key[i] != '_')
return (0); return (0);
return (1); return (1);
} }

View File

@ -6,7 +6,7 @@
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */ /* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2023/02/21 12:45:16 by cchauvet #+# #+# */ /* Created: 2023/02/21 12:45:16 by cchauvet #+# #+# */
/* Updated: 2023/02/23 16:49:49 by erey-bet ### ########.fr */ /* Updated: 2023/02/28 13:15:23 by erey-bet ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -110,7 +110,7 @@ static int ft_own_cmd(t_data *data, t_cmd *cmd)
else if (ft_strcmp(cmd->executable, "export") == 0) else if (ft_strcmp(cmd->executable, "export") == 0)
return_code = (export(data->env,cmd->args + 1, cmd->fd_out)); return_code = (export(data->env,cmd->args + 1, cmd->fd_out));
else if (ft_strcmp(cmd->executable, "cd") == 0) 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) if (ft_strcmp(cmd->executable, "unset") == 0)
return_code = (unset(data->env, cmd->args, cmd->fd_out)); return_code = (unset(data->env, cmd->args, cmd->fd_out));
else if (ft_strcmp(cmd->executable, "echo") == 0) else if (ft_strcmp(cmd->executable, "echo") == 0)

View File

@ -6,7 +6,7 @@
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */ /* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2023/02/14 13:45:30 by cchauvet #+# #+# */ /* Created: 2023/02/14 13:45:30 by cchauvet #+# #+# */
/* Updated: 2023/02/24 12:31:02 by erey-bet ### ########.fr */ /* Updated: 2023/02/28 13:14:57 by erey-bet ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -81,7 +81,7 @@ int print_env(t_list **env, int fd);
/* Export */ /* Export */
int export(t_list **env, char **args, int fd); int export(t_list **env, char **args, int fd);
/* CD */ /* CD */
int move_folder(char *path, int fd); int move_folder(char **args, int fd);
/* Unset */ /* Unset */
int unset(t_list **env, char **args, int fd); int unset(t_list **env, char **args, int fd);
/* Exit */ /* Exit */