This commit is contained in:
Jack Halford 2017-03-25 15:13:12 +01:00
parent 91e9df5721
commit a40f95ad32
7 changed files with 10 additions and 30 deletions

View file

@ -29,6 +29,9 @@ INC_DIR = includes/
OBJ_DIR = objs/ OBJ_DIR = objs/
SRC_BASE = \ 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_get.c\
builtin/bt_read_term.c\ builtin/bt_read_term.c\
builtin/builtin_cd.c\ builtin/builtin_cd.c\
@ -40,11 +43,11 @@ builtin/builtin_func.c\
builtin/builtin_hash.c\ builtin/builtin_hash.c\
builtin/builtin_history.c\ builtin/builtin_history.c\
builtin/builtin_math.c\ builtin/builtin_math.c\
builtin/builtin_new_cd.c\
builtin/builtin_read.c\ builtin/builtin_read.c\
builtin/builtin_setenv.c\ builtin/builtin_setenv.c\
builtin/builtin_unset.c\ builtin/builtin_unset.c\
builtin/builtin_unsetenv.c\ builtin/builtin_unsetenv.c\
builtin/error_msg.c\
builtin/is_builtin.c\ builtin/is_builtin.c\
completion/c_arrow.c\ completion/c_arrow.c\
completion/c_clear.c\ completion/c_clear.c\

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */ /* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/14 17:24:23 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 open_access(char *file, t_flag a_flag, t_flag o_flag, t_flag o_perm);
int is_directory(const char *path); 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 dup2_close(int fd1, int fd2);
int fd_replace(int fd1, int fd2); int fd_replace(int fd1, int fd2);

View file

@ -6,7 +6,7 @@
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */ /* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/25 03:18:18 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 */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */ /* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/22 16:20:31 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_USAGE "env [-i] [name=value]... [utility [argument...]]"
#define ENV_NOFILE "env: %s: No such file or directory" #define ENV_NOFILE "env: %s: No such file or directory"
#define ENV_NOPERM "env: %s: Permission denied" #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[] = static t_cliopts g_env_opts[] =
{ {

View file

@ -6,7 +6,7 @@
/* By: wescande <wescande@student.42.fr> +#+ +:+ +#+ */ /* By: wescande <wescande@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/24 15:03:02 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 */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */ /* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/01/20 15:01:45 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; i = 0;
if (data->prompt && (data->flag & BT_READ_INTER)) if (data->prompt && (data->flag & BT_READ_INTER))
ft_printf(data->prompt); ft_printf(data->prompt);
DG("nchars; %i, opts=%b", data->nchars, data->flag);
while (42) while (42)
{ {
if ((ret = read(data->fd, buf, 1)) <= 0) if ((ret = read(data->fd, buf, 1)) <= 0)
@ -69,7 +68,6 @@ int bt_read_loop(t_read *data)
if (*buf == '\n' && !(data->flag & if (*buf == '\n' && !(data->flag &
(BT_READ_LR | BT_READ_LS | BT_READ_INTER))) (BT_READ_LR | BT_READ_LS | BT_READ_INTER)))
ft_putstr("> "); ft_putstr("> ");
DG("%i/%i", i, data->nchars);
if ((data->flag & BT_READ_LN) && ++i >= data->nchars) if ((data->flag & BT_READ_LN) && ++i >= data->nchars)
break ; break ;
} }

View file

@ -1,19 +0,0 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* error_msg.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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);
}