This commit is contained in:
commit
e5f26c3582
3 changed files with 5 additions and 8 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: wescande <wescande@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/03/24 15:03:02 by wescande #+# #+# */
|
||||
/* Updated: 2017/03/24 17:04:11 by gwojda ### ########.fr */
|
||||
/* Updated: 2017/03/24 17:11:50 by gwojda ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/02/09 22:03:48 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/23 15:17:27 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/03/24 17:02:40 by wescande ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -25,10 +25,8 @@ int lexer_bquote(t_list **alst, t_lexer *lexer)
|
|||
if (get_lexer_stack(*lexer) != BQUOTE)
|
||||
push(&lexer->stack, lexer->state);
|
||||
else
|
||||
{
|
||||
lexer->state = pop(&lexer->stack) &&
|
||||
get_lexer_stack(*lexer) == DQUOTE ? DQUOTE : DEFAULT;
|
||||
}
|
||||
}
|
||||
else if (lexer->str[lexer->pos] == '\\' && (back = 1))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/12/12 17:23:59 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/24 15:12:31 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/03/24 17:05:29 by wescande ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -29,10 +29,9 @@ int get_c_arg(char ***av, t_data *data)
|
|||
return (0);
|
||||
}
|
||||
|
||||
static int get_input_fd(t_data *data)
|
||||
static int get_input_fd(t_data *data, char *file)
|
||||
{
|
||||
static int fds[2] = {-1, STDIN};
|
||||
char *file;
|
||||
struct stat buf;
|
||||
|
||||
if (data->opts & SH_OPTS_LC && (file = data->c_arg))
|
||||
|
|
@ -94,7 +93,7 @@ int shell_init(int ac, char **av)
|
|||
}
|
||||
if (!isatty(STDIN) || *data->av_data)
|
||||
data->opts &= ~(SH_INTERACTIVE | SH_OPTS_JOBC);
|
||||
if ((data->fd = get_input_fd(data)) < 0)
|
||||
if ((data->fd = get_input_fd(data, NULL)) < 0)
|
||||
return (-1);
|
||||
if (SH_IS_INTERACTIVE(data->opts) && interactive_settings() < 0)
|
||||
return (-1);
|
||||
|
|
|
|||
Loading…
Reference in a new issue