math builtin
This commit is contained in:
commit
de5f4b2a46
7 changed files with 15 additions and 11 deletions
|
|
@ -3,9 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* builtin.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
|
||||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/12/13 17:21:56 by jhalford #+# #+# */
|
||||
/* Created: 2017/03/14 22:59:57 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/14 22:59:57 by jhalford ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/03/07 15:48:24 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/13 23:35:37 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/03/14 22:34:53 by jhalford ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/03/07 14:53:31 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/14 21:48:36 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/03/14 22:34:06 by jhalford ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/03/13 22:21:19 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/13 23:10:42 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/03/14 22:34:22 by jhalford ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/12/15 14:19:48 by gwojda #+# #+# */
|
||||
/* Updated: 2017/03/14 21:34:46 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/03/14 22:19:43 by jhalford ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -15,7 +15,10 @@
|
|||
int readline(int fd, int prompt, char **input)
|
||||
{
|
||||
if (!SH_IS_INTERACTIVE(data_singleton()->opts))
|
||||
{
|
||||
DG("GNL on fd=%i", fd);
|
||||
return (get_next_line(fd, input) == 0);
|
||||
}
|
||||
readline_init(prompt);
|
||||
*input = ft_read_stdin();
|
||||
if (STR)
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/12/06 18:40:58 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/14 22:51:29 by ariard ### ########.fr */
|
||||
/* Updated: 2017/03/14 23:06:10 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@
|
|||
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/12/12 17:23:59 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/14 21:50:11 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/03/14 22:21:28 by jhalford ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "minishell.h"
|
||||
|
||||
static t_cliopts shell_opts[] =
|
||||
static t_cliopts g_opts[] =
|
||||
{
|
||||
{'c', NULL, SH_OPTS_LC, SH_OPTS_JOBC | SH_INTERACTIVE, NULL},
|
||||
{-1, "no-jobcontrol", 0, SH_OPTS_JOBC, NULL},
|
||||
|
|
@ -40,7 +40,7 @@ static int interactive_settings(void)
|
|||
if (setpgid(*shell_pgid, *shell_pgid))
|
||||
{
|
||||
ft_dprintf(2, "Couldnt put the shell in it's own process group");
|
||||
exit (1);
|
||||
exit(1);
|
||||
}
|
||||
tcsetpgrp(STDIN, *shell_pgid);
|
||||
tcgetattr(STDIN, &data->jobc.shell_tmodes);
|
||||
|
|
@ -61,7 +61,7 @@ int shell_init(int ac, char **av)
|
|||
}
|
||||
else
|
||||
DG("non interactive");
|
||||
if (cliopts_get(av, shell_opts, data))
|
||||
if (cliopts_get(av, g_opts, data))
|
||||
return (ft_perror());
|
||||
if (SH_IS_INTERACTIVE(data->opts))
|
||||
interactive_settings();
|
||||
|
|
|
|||
Loading…
Reference in a new issue