bang stories

This commit is contained in:
Antoine Riard 2017-03-27 19:57:09 +02:00
commit 73d186071b
3 changed files with 6 additions and 7 deletions

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/20 12:36:10 by jhalford #+# #+# */
/* Updated: 2017/03/25 01:45:49 by jhalford ### ########.fr */
/* Updated: 2017/03/27 19:41:50 by jhalford ### ########.fr */
/* */
/* ************************************************************************** */
@ -21,7 +21,6 @@ int redirect_dless(t_redir *redir)
str = redir->heredoc_data;
write(fds[PIPE_WRITE], str, ft_strlen(str));
close(fds[PIPE_WRITE]);
dup2(fds[PIPE_READ], redir->n);
close(fds[PIPE_READ]);
fd_replace(fds[PIPE_READ], redir->n);
return (0);
}

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/02/09 20:39:06 by jhalford #+# #+# */
/* Updated: 2017/03/27 19:18:47 by ariard ### ########.fr */
/* Updated: 2017/03/27 19:56:59 by ariard ### ########.fr */
/* */
/* ************************************************************************** */
@ -32,8 +32,7 @@ t_lexstate get_state_global(t_lexer *lexer)
|| ((c == '`') && (ret = BQUOTE))
|| ((c == '(' || c == ')') && (ret = PAREN))
|| (((c == '{' && (cn == ' ' || cn == 0))
|| (c == '}' && (cl == ' ' || cl == 0)))
&& (ret = CURLY_BRACKETS))
|| (c == '}' && (cl == ' ' || cl == 0))) && (ret = CURLY_BRACKETS))
|| ((c == 0) && (ret = END)))
{
;

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/12 17:23:59 by jhalford #+# #+# */
/* Updated: 2017/03/27 18:08:56 by jhalford ### ########.fr */
/* Updated: 2017/03/27 19:41:47 by jhalford ### ########.fr */
/* */
/* ************************************************************************** */
@ -100,5 +100,6 @@ int shell_init(int ac, char **av, char **env)
if (SH_IS_INTERACTIVE(data->opts) && interactive_settings() < 0)
return (-1);
shell_fds_init();
shell_fds_push();
return (0);
}