Merge branch 'master' of github.com:jzck/42sh

This commit is contained in:
wescande 2017-03-15 16:34:24 +01:00
commit 5d37f0e720
6 changed files with 25 additions and 8 deletions

View file

@ -84,6 +84,7 @@ exec/ft_findexec.c\
exec/is_function.c\
exec/mark_process_status.c\
exec/node_copy.c\
exec/op_stack_free.c\
exec/pfree_cmd.c\
exec/pfree_cond.c\
exec/pfree_list.c\

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/27 20:29:56 by jhalford #+# #+# */
/* Updated: 2017/03/15 01:07:00 by ariard ### ########.fr */
/* Updated: 2017/03/15 16:06:24 by gwojda ### ########.fr */
/* */
/* ************************************************************************** */
@ -133,6 +133,8 @@ struct s_exec
int control_count;
};
void op_stack_free(void *data, size_t content_size);
int exec_reset(void);
int process_setgroup(t_process *p, pid_t pid);
void process_setsig(void);

View file

@ -3,10 +3,10 @@
/* ::: :::::::: */
/* exec_semi.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/30 20:52:05 by jhalford #+# #+# */
/* Updated: 2017/03/10 14:55:05 by ariard ### ########.fr */
/* Updated: 2017/03/15 15:55:43 by gwojda ### ########.fr */
/* */
/* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/13 14:58:36 by jhalford #+# #+# */
/* Updated: 2017/03/15 11:14:27 by gwojda ### ########.fr */
/* Updated: 2017/03/15 15:51:30 by gwojda ### ########.fr */
/* */
/* ************************************************************************** */
@ -22,8 +22,8 @@ int put_job_in_foreground(t_job *j, int cont)
tcsetpgrp(STDIN, j->pgid);
if (cont)
{
// j->tmodes = pas initialisé !
tcsetattr(STDIN, TCSADRAIN, &j->tmodes);
// j->tmodes = pas initialisé !
//tcsetattr(STDIN, TCSADRAIN, &j->tmodes);
if (kill(-j->pgid, SIGCONT) < 0)
DG("kill(SIGCONT) failed");
}

View file

@ -1,11 +1,24 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* instruction_free.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/15 15:54:59 by gwojda #+# #+# */
/* Updated: 2017/03/15 16:06:34 by gwojda ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
int instruction_free(t_list **token, t_parser *parser, t_btree **ast)
{
{
ft_lstdel(token, &token_free);
token = NULL;
ft_lstdel(&parser->stack, NULL);
btree_del(ast, &ast_free);
ft_lstdel(&data_singleton()->heredoc_queue, &redir_free);
ft_lstdel(&data_singleton()->exec.op_stack, &op_stack_free);
return (0);
}

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/06 18:40:58 by jhalford #+# #+# */
/* Updated: 2017/03/15 13:46:36 by gwojda ### ########.fr */
/* Updated: 2017/03/15 16:12:35 by gwojda ### ########.fr */
/* */
/* ************************************************************************** */
@ -74,6 +74,7 @@ int handle_instruction(int fd)
if (ft_exec(&ast))
return (2);
instruction_free(&token, &parser, &ast);
ft_lstdel(&parser.stack, &op_stack_free);
if (SH_IS_INTERACTIVE(data_singleton()->opts) && *lexer.str)
ft_add_str_in_history(lexer.str);
ft_strdel(&lexer.str);