From a40f95ad32553f8d33f1efa09055698c09690a2a Mon Sep 17 00:00:00 2001 From: Jack Halford Date: Sat, 25 Mar 2017 15:13:12 +0100 Subject: [PATCH] norme --- 42sh/Makefile | 5 ++++- 42sh/libft/includes/sys.h | 4 ++-- 42sh/libft/src/sys/create_directory.c | 2 +- 42sh/src/builtin/builtin_env.c | 4 +--- 42sh/src/builtin/builtin_func.c | 2 +- 42sh/src/builtin/builtin_read.c | 4 +--- 42sh/src/builtin/error_msg.c | 19 ------------------- 7 files changed, 10 insertions(+), 30 deletions(-) delete mode 100644 42sh/src/builtin/error_msg.c diff --git a/42sh/Makefile b/42sh/Makefile index dcb635d7..21b59435 100644 --- a/42sh/Makefile +++ b/42sh/Makefile @@ -29,6 +29,9 @@ INC_DIR = includes/ OBJ_DIR = objs/ SRC_BASE = \ +builtin/bt_cd_getpath.c\ +builtin/bt_cd_process_dotdot.c\ +builtin/bt_cd_process_symlink.c\ builtin/bt_read_get.c\ builtin/bt_read_term.c\ builtin/builtin_cd.c\ @@ -40,11 +43,11 @@ builtin/builtin_func.c\ builtin/builtin_hash.c\ builtin/builtin_history.c\ builtin/builtin_math.c\ +builtin/builtin_new_cd.c\ builtin/builtin_read.c\ builtin/builtin_setenv.c\ builtin/builtin_unset.c\ builtin/builtin_unsetenv.c\ -builtin/error_msg.c\ builtin/is_builtin.c\ completion/c_arrow.c\ completion/c_clear.c\ diff --git a/42sh/libft/includes/sys.h b/42sh/libft/includes/sys.h index 229af35c..b3c42e22 100644 --- a/42sh/libft/includes/sys.h +++ b/42sh/libft/includes/sys.h @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/14 17:24:23 by jhalford #+# #+# */ -/* Updated: 2017/03/25 04:07:20 by ariard ### ########.fr */ +/* Updated: 2017/03/25 15:12:52 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -35,7 +35,7 @@ char *ft_getenv(char **env, char *key); int open_access(char *file, t_flag a_flag, t_flag o_flag, t_flag o_perm); int is_directory(const char *path); -char *create_direcotry(const char *path, const char *old_pathnames); +char *create_directory(const char *path, const char *old_pathnames); int dup2_close(int fd1, int fd2); int fd_replace(int fd1, int fd2); diff --git a/42sh/libft/src/sys/create_directory.c b/42sh/libft/src/sys/create_directory.c index bf2b0e44..6a8967ca 100644 --- a/42sh/libft/src/sys/create_directory.c +++ b/42sh/libft/src/sys/create_directory.c @@ -6,7 +6,7 @@ /* By: ariard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/25 03:18:18 by ariard #+# #+# */ -/* Updated: 2017/03/25 15:03:24 by jhalford ### ########.fr */ +/* Updated: 2017/03/25 15:12:34 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/42sh/src/builtin/builtin_env.c b/42sh/src/builtin/builtin_env.c index fbb147c2..4f17fbbf 100644 --- a/42sh/src/builtin/builtin_env.c +++ b/42sh/src/builtin/builtin_env.c @@ -6,7 +6,7 @@ /* By: gwojda +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/22 16:20:31 by gwojda #+# #+# */ -/* Updated: 2017/03/25 02:10:38 by wescande ### ########.fr */ +/* Updated: 2017/03/25 15:10:52 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -15,8 +15,6 @@ #define ENV_USAGE "env [-i] [name=value]... [utility [argument...]]" #define ENV_NOFILE "env: %s: No such file or directory" #define ENV_NOPERM "env: %s: Permission denied" -/* # define BT_ENV_LI (1 << 0) */ -/* # define BT_ENV_LU (1 << 1) */ static t_cliopts g_env_opts[] = { diff --git a/42sh/src/builtin/builtin_func.c b/42sh/src/builtin/builtin_func.c index 48a6efdd..1c03a2b1 100644 --- a/42sh/src/builtin/builtin_func.c +++ b/42sh/src/builtin/builtin_func.c @@ -6,7 +6,7 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/24 15:03:02 by wescande #+# #+# */ -/* Updated: 2017/03/24 17:11:50 by gwojda ### ########.fr */ +/* Updated: 2017/03/25 15:08:37 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/42sh/src/builtin/builtin_read.c b/42sh/src/builtin/builtin_read.c index 438bf554..35743e5d 100644 --- a/42sh/src/builtin/builtin_read.c +++ b/42sh/src/builtin/builtin_read.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/01/20 15:01:45 by jhalford #+# #+# */ -/* Updated: 2017/03/25 04:19:34 by jhalford ### ########.fr */ +/* Updated: 2017/03/25 15:10:27 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -56,7 +56,6 @@ int bt_read_loop(t_read *data) i = 0; if (data->prompt && (data->flag & BT_READ_INTER)) ft_printf(data->prompt); - DG("nchars; %i, opts=%b", data->nchars, data->flag); while (42) { if ((ret = read(data->fd, buf, 1)) <= 0) @@ -69,7 +68,6 @@ int bt_read_loop(t_read *data) if (*buf == '\n' && !(data->flag & (BT_READ_LR | BT_READ_LS | BT_READ_INTER))) ft_putstr("> "); - DG("%i/%i", i, data->nchars); if ((data->flag & BT_READ_LN) && ++i >= data->nchars) break ; } diff --git a/42sh/src/builtin/error_msg.c b/42sh/src/builtin/error_msg.c deleted file mode 100644 index cca32129..00000000 --- a/42sh/src/builtin/error_msg.c +++ /dev/null @@ -1,19 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* error_msg.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: ariard +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2017/03/20 23:21:37 by ariard #+# #+# */ -/* Updated: 2017/03/21 15:20:26 by jhalford ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "minishell.h" - -int error_msg(char *msg) -{ - ft_dprintf(2, "{red}%s{eoc}", msg); - return (1); -}