merging luke remote with origin local
This commit is contained in:
14
srcs/init.c
14
srcs/init.c
@@ -6,7 +6,7 @@
|
||||
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2021/10/08 09:22:12 by lperrey #+# #+# */
|
||||
/* Updated: 2021/10/28 11:07:40 by hulamy ### ########.fr */
|
||||
/* Updated: 2021/11/02 13:50:33 by hulamy ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -15,9 +15,10 @@
|
||||
static char *init_prompt_base(void);
|
||||
static char *init_prompt(char *prompt_base);
|
||||
|
||||
int init(t_all *c, char *envp[])
|
||||
int init(t_all *c, char *envp[])
|
||||
{
|
||||
ft_bzero(c, sizeof *c);
|
||||
g_all = c;
|
||||
ft_bzero(c, sizeof (*c));
|
||||
c->envp = ft_dup_2d_char_arr(envp);
|
||||
if (!c->envp)
|
||||
return (ft_reti_perror(0, "ft_dup_2d_char_arr(envp) error"));
|
||||
@@ -27,6 +28,13 @@ int init(t_all *c, char *envp[])
|
||||
c->prompt = init_prompt(c->prompt_base);
|
||||
if (!c->prompt)
|
||||
return (ft_reti_perror(0, "init_prompt() error"));
|
||||
set_signals_handling(&c->ori_signal_behaviour, &c->signal_behaviour);
|
||||
if (isatty(STDIN_FILENO))
|
||||
{
|
||||
if (!set_terminal_attributes(&c->ori_termios, &c->interactive_termios,
|
||||
&c->termios_changed))
|
||||
return (ft_reti_perror(0, "set_terminal_attributes() error"));
|
||||
}
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user