variable extern environ fonction avec getenv et export ok
This commit is contained in:
15
srcs/init.c
15
srcs/init.c
@@ -6,7 +6,7 @@
|
||||
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2021/10/08 09:22:12 by lperrey #+# #+# */
|
||||
/* Updated: 2021/11/18 21:56:06 by hulamy ### ########.fr */
|
||||
/* Updated: 2021/11/25 18:57:59 by hulamy ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -15,15 +15,18 @@
|
||||
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[])
|
||||
int init(t_all *c, char **environ)
|
||||
{
|
||||
(void)environ;
|
||||
g_all = c;
|
||||
ft_bzero(c, sizeof (*c));
|
||||
c->envp = ft_dup_2d_arr(envp, (t_dup_f)ft_strdup); // TEST WIP
|
||||
if (!c->envp)
|
||||
return (ft_reti_perror(0, "ft_dup_2d_char_arr(envp) error"));
|
||||
// c->envp = ft_dup_2d_arr(envp, (t_dup_f)ft_strdup); // TEST WIP
|
||||
// if (!c->envp)
|
||||
// return (ft_reti_perror(0, "ft_dup_2d_char_arr(envp) error"));
|
||||
//print_matrix(c->envp, "\n --- \n"); // TEST WIP
|
||||
c->path = retrieve_path(c->envp); // No return check. Its intended. PATH is optional
|
||||
//c->path = retrieve_path(c->envp); // No return check. Its intended. PATH is optional
|
||||
c->path = retrieve_path(environ); // No return check. Its intended. PATH is optional
|
||||
c->prompt_base = init_prompt_base();
|
||||
if (!c->prompt_base)
|
||||
return (ft_reti_perror(0, "init_prompt_base() error"));
|
||||
|
||||
Reference in New Issue
Block a user