diff --git a/42sh/src/builtin/bt_read_term.c b/42sh/src/builtin/bt_read_term.c index 853929c4..131eaaf7 100644 --- a/42sh/src/builtin/bt_read_term.c +++ b/42sh/src/builtin/bt_read_term.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/01/25 16:02:05 by jhalford #+# #+# */ -/* Updated: 2017/01/27 19:00:10 by jhalford ### ########.fr */ +/* Updated: 2017/02/06 13:56:47 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -27,7 +27,9 @@ int bt_read_terminit(t_read *data) (void)data; term = bt_read_term(1); - term.c_lflag &= ~(ECHO | ICANON); + term.c_lflag &= ~(ICANON); + if (data->opts & READ_OPT_LS) + term.c_lflag &= ~(ECHO); if (data->opts & READ_OPT_LT) { term.c_cc[VTIME] = data->timeout * 10; diff --git a/42sh/src/builtin/builtin_read.c b/42sh/src/builtin/builtin_read.c index 586f3627..cba5e4e6 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/01/27 19:40:12 by jhalford ### ########.fr */ +/* Updated: 2017/02/06 14:02:17 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -28,14 +28,15 @@ t_readopt g_readtab[] = {0, 0, 0}, }; + int bt_read_loop(t_read *data) { int i; int esc; char buf[2]; - i = 0; esc = 0; + i = 0; if (data->prompt) ft_printf(data->prompt); while (42) @@ -43,12 +44,11 @@ int bt_read_loop(t_read *data) if (read(data->fd, buf, 1) <= 0) return (1); buf[1] = 0; + DG("got input [%x]", *buf); if (!esc && *buf == data->delim) break ; esc = esc ? 0 : !(data->opts & READ_OPT_LR) && (*buf == '\\'); ft_strappend(&data->input, buf); - if (!(data->opts & READ_OPT_LS)) - ft_putchar(*buf); if (*buf == '\n' && !(data->opts & READ_OPT_LR)) ft_putstr("> "); if ((data->opts & READ_OPT_LN) && ++i >= data->nchars) @@ -73,6 +73,7 @@ int bt_read_assign(t_read *data) { if (!(names[1]) || !IFS) { + DG("setting env: %s=%x%x%x", *names, *start, start[1],start[2]); builtin_setenv("setenv", (char*[]){"setenv", *names, start}, NULL); break ; } diff --git a/42sh/src/builtin/builtin_setenv.c b/42sh/src/builtin/builtin_setenv.c index 3c566d6b..80359846 100644 --- a/42sh/src/builtin/builtin_setenv.c +++ b/42sh/src/builtin/builtin_setenv.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/28 14:25:17 by jhalford #+# #+# */ -/* Updated: 2017/01/27 19:00:07 by jhalford ### ########.fr */ +/* Updated: 2017/02/06 14:05:23 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -34,8 +34,6 @@ int builtin_setenv(const char *path, char *const av[], char *const envp[]) str = ft_str3join(av[0], "=", av[1]); while ((*env)[i]) { - /* DG("check 2: i=%i, (*env)[i]=%p",i, (*env)[i]); */ - /* DG("content=%s", (*env)[i]); */ if (ft_strcmp((*env)[i], av[0]) == '=') { ft_strdel(&(*env)[i]); diff --git a/42sh/src/lexer/lexer_var.c b/42sh/src/lexer/lexer_var.c index ab6e0b79..b02b71ac 100644 --- a/42sh/src/lexer/lexer_var.c +++ b/42sh/src/lexer/lexer_var.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/01/10 14:54:57 by jhalford #+# #+# */ -/* Updated: 2017/01/27 15:55:54 by wescande ### ########.fr */ +/* Updated: 2017/02/06 14:02:20 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/42sh/src/lexer/token_expand_var.c b/42sh/src/lexer/token_expand_var.c index 9743d062..f252a29d 100644 --- a/42sh/src/lexer/token_expand_var.c +++ b/42sh/src/lexer/token_expand_var.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/01/10 14:57:53 by jhalford #+# #+# */ -/* Updated: 2017/01/27 15:56:40 by wescande ### ########.fr */ +/* Updated: 2017/02/06 14:05:25 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/42sh/src/main/main.c b/42sh/src/main/main.c index 86709d2e..425c5223 100644 --- a/42sh/src/main/main.c +++ b/42sh/src/main/main.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/06 18:40:58 by jhalford #+# #+# */ -/* Updated: 2017/02/03 17:33:56 by jhalford ### ########.fr */ +/* Updated: 2017/02/06 13:26:34 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */