ASTERIX IL SUCE IDEFIX DANS LES CHIOTTES
This commit is contained in:
parent
ca18dd4205
commit
ed546f5a8d
2
Makefile
2
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}
|
||||
|
||||
|
6
env3.c
6
env3.c
@ -6,7 +6,7 @@
|
||||
/* By: erey-bet <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* 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 */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -89,10 +89,10 @@ int possible_key(char *key)
|
||||
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);
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* 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)
|
||||
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)
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* 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 */
|
||||
int export(t_list **env, char **args, int fd);
|
||||
/* CD */
|
||||
int move_folder(char *path, int fd);
|
||||
int move_folder(char **args, int fd);
|
||||
/* Unset */
|
||||
int unset(t_list **env, char **args, int fd);
|
||||
/* Exit */
|
||||
|
Loading…
Reference in New Issue
Block a user