issue #71 done (lexer problem)
This commit is contained in:
parent
9a5c35ff4b
commit
2659b68d28
9 changed files with 18 additions and 13 deletions
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2016/11/27 20:29:56 by jhalford #+# #+# */
|
/* Created: 2016/11/27 20:29:56 by jhalford #+# #+# */
|
||||||
/* Updated: 2017/03/10 12:11:21 by jhalford ### ########.fr */
|
/* Updated: 2017/03/10 13:10:03 by jhalford ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2017/03/08 14:31:42 by jhalford #+# #+# */
|
/* Created: 2017/03/08 14:31:42 by jhalford #+# #+# */
|
||||||
/* Updated: 2017/03/10 12:55:57 by jhalford ### ########.fr */
|
/* Updated: 2017/03/10 13:13:49 by jhalford ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2017/03/09 14:51:23 by jhalford #+# #+# */
|
/* Created: 2017/03/09 14:51:23 by jhalford #+# #+# */
|
||||||
/* Updated: 2017/03/10 12:51:38 by jhalford ### ########.fr */
|
/* Updated: 2017/03/10 13:09:25 by jhalford ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
@ -15,11 +15,14 @@
|
||||||
void process_resetfds(t_process *p)
|
void process_resetfds(t_process *p)
|
||||||
{
|
{
|
||||||
t_exec *exec;
|
t_exec *exec;
|
||||||
|
int i;
|
||||||
|
|
||||||
(void)p;
|
(void)p;
|
||||||
exec = &data_singleton()->exec;
|
exec = &data_singleton()->exec;
|
||||||
|
i = 0;
|
||||||
|
while (i < 10)
|
||||||
|
close(i++);
|
||||||
dup2(exec->fd_save[0], STDIN);
|
dup2(exec->fd_save[0], STDIN);
|
||||||
close(STDOUT);
|
|
||||||
dup2(exec->fd_save[1], STDOUT);
|
dup2(exec->fd_save[1], STDOUT);
|
||||||
dup2(exec->fd_save[2], STDERR);
|
dup2(exec->fd_save[2], STDERR);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
|
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2017/02/14 11:27:03 by gwojda #+# #+# */
|
/* Created: 2017/02/14 11:27:03 by gwojda #+# #+# */
|
||||||
/* Updated: 2017/03/10 12:10:03 by gwojda ### ########.fr */
|
/* Updated: 2017/03/10 12:59:26 by jhalford ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2017/02/09 20:37:28 by jhalford #+# #+# */
|
/* Created: 2017/02/09 20:37:28 by jhalford #+# #+# */
|
||||||
/* Updated: 2017/02/24 20:44:40 by ariard ### ########.fr */
|
/* Updated: 2017/03/10 13:12:51 by jhalford ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2016/12/03 12:06:35 by jhalford #+# #+# */
|
/* Created: 2016/12/03 12:06:35 by jhalford #+# #+# */
|
||||||
/* Updated: 2017/03/08 12:10:46 by jhalford ### ########.fr */
|
/* Updated: 2017/03/10 13:11:30 by jhalford ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
@ -17,8 +17,8 @@ int lexer_great(t_list **alst, t_lexer *lexer)
|
||||||
t_token *token;
|
t_token *token;
|
||||||
|
|
||||||
token = (*alst)->content;
|
token = (*alst)->content;
|
||||||
/* if (token->type) */
|
if (token->type)
|
||||||
/* return (lexer_lex(&(*alst)->next, lexer)); */
|
return (lexer_lex(&(*alst)->next, lexer));
|
||||||
token_append(token, lexer, 0, 0);
|
token_append(token, lexer, 0, 0);
|
||||||
lexer->pos++;
|
lexer->pos++;
|
||||||
if (lexer->str[lexer->pos] == '&')
|
if (lexer->str[lexer->pos] == '&')
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2016/12/03 12:06:53 by jhalford #+# #+# */
|
/* Created: 2016/12/03 12:06:53 by jhalford #+# #+# */
|
||||||
/* Updated: 2017/03/08 23:34:58 by ariard ### ########.fr */
|
/* Updated: 2017/03/10 13:11:27 by jhalford ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
@ -17,6 +17,8 @@ int lexer_less(t_list **alst, t_lexer *lexer)
|
||||||
t_token *token;
|
t_token *token;
|
||||||
|
|
||||||
token = (*alst)->content;
|
token = (*alst)->content;
|
||||||
|
if (token->type)
|
||||||
|
return (lexer_lex(&(*alst)->next, lexer));
|
||||||
lexer->pos++;
|
lexer->pos++;
|
||||||
if (lexer->str[lexer->pos] == '&')
|
if (lexer->str[lexer->pos] == '&')
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2016/12/03 12:06:45 by jhalford #+# #+# */
|
/* Created: 2016/12/03 12:06:45 by jhalford #+# #+# */
|
||||||
/* Updated: 2017/03/08 23:35:37 by ariard ### ########.fr */
|
/* Updated: 2017/03/10 13:12:43 by jhalford ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
@ -38,7 +38,7 @@ int lexer_number(t_list **alst, t_lexer *lexer)
|
||||||
{
|
{
|
||||||
token_append(token, lexer, 0, 0);
|
token_append(token, lexer, 0, 0);
|
||||||
lexer->pos++;
|
lexer->pos++;
|
||||||
return (lexer_lex(&(*alst)->next, lexer));
|
return (lexer_lex(alst, lexer));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
|
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2016/12/06 18:40:58 by jhalford #+# #+# */
|
/* Created: 2016/12/06 18:40:58 by jhalford #+# #+# */
|
||||||
/* Updated: 2017/03/10 12:12:24 by jhalford ### ########.fr */
|
/* Updated: 2017/03/10 13:13:51 by jhalford ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue