diff --git a/42sh/src/exec/exec_reset.c b/42sh/src/exec/exec_reset.c index c4ba1f07..e1865178 100644 --- a/42sh/src/exec/exec_reset.c +++ b/42sh/src/exec/exec_reset.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/08 14:31:42 by jhalford #+# #+# */ -/* Updated: 2017/03/22 18:26:03 by jhalford ### ########.fr */ +/* Updated: 2017/03/24 14:06:48 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -16,7 +16,7 @@ int exec_reset_job(t_job *job) { job->id = 0; job->pgid = 0; - job->attrs = JOB_NOTIFIED; + job->attrs = 0; job->first_process = NULL; return (0); } diff --git a/42sh/src/job_control/builtin_jobs.c b/42sh/src/job_control/builtin_jobs.c index 7a4c35b3..15f0e33a 100644 --- a/42sh/src/job_control/builtin_jobs.c +++ b/42sh/src/job_control/builtin_jobs.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/15 17:43:01 by jhalford #+# #+# */ -/* Updated: 2017/03/24 12:35:04 by wescande ### ########.fr */ +/* Updated: 2017/03/24 14:08:12 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -66,13 +66,13 @@ int builtin_jobs(const char *path, char *const av[], char *const envp[]) (void)path; (void)envp; - ft_bzero(&data, sizeof(t_data_template)); do_job_notification(); if (!SH_HAS_JOBC(data_singleton()->opts)) { SH_ERR("jobs: %s", SH_MSG_NOJOBC); return (1); } + ft_bzero(&data, sizeof(t_data_template)); if (cliopts_get((char**)av, g_jobs_opts, &data)) return (ft_perror()); if (!*data.av_data) diff --git a/42sh/src/lexer/get_state_global.c b/42sh/src/lexer/get_state_global.c index 0fa045fc..b3b1846c 100644 --- a/42sh/src/lexer/get_state_global.c +++ b/42sh/src/lexer/get_state_global.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/02/09 20:39:06 by jhalford #+# #+# */ -/* Updated: 2017/03/20 15:00:58 by jhalford ### ########.fr */ +/* Updated: 2017/03/24 14:20:30 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -21,7 +21,8 @@ t_lexstate get_state_global(t_lexer *lexer) c = lexer->str[lexer->pos]; cn = lexer->str[lexer->pos + 1]; - cl = lexer->str[lexer->pos ? lexer->pos - 1 : 0]; + cl = lexer->pos ? lexer->str[lexer->pos - 1] : 0; + DG("%i : '%c'", lexer->pos, cl); ret = 0; if ((ft_is_delim(c) && (ret = DELIM)) || ((c == '&' || c == ';' || c == '|' || c == '!') && (ret = SEP)) @@ -31,7 +32,8 @@ t_lexstate get_state_global(t_lexer *lexer) || ((c == '\"') && (ret = DQUOTE)) || ((c == '`') && (ret = BQUOTE)) || ((c == '(' || c == ')') && (ret = PAREN)) - || (((c == '{' && cn == ' ') || (c == '}' && cl == ' ')) + || (((c == '{' && (cn == ' ' || cn == 0)) + || (c == '}' && (cl == ' ' || cl == 0))) && (ret = CURLY_BRACKETS)) || ((c == 0) && (ret = END))) {