CO-CODE Hugo-Luke

+ last_exit_status set/get functions for here_doc
+ TODO : replace all occurences of last_exit_status
+ **environ fix
+ builtin_unset() fix
This commit is contained in:
LuckyLaszlo
2021-11-26 20:44:29 +01:00
parent 3465354af5
commit 18d430c5cb
13 changed files with 119 additions and 239 deletions

View File

@@ -6,7 +6,7 @@
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/10/08 09:22:12 by lperrey #+# #+# */
/* Updated: 2021/11/25 23:59:33 by hulamy ### ########.fr */
/* Updated: 2021/11/26 19:02:24 by lperrey ### ########.fr */
/* */
/* ************************************************************************** */
@@ -18,16 +18,16 @@ static char *init_prompt_base(void);
char *init_prompt(char *prompt_base);
//int init(t_all *c, char *envp[])
int init(t_all *c, char **environ)
int init(t_all *c)
{
(void)environ;
extern char **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"));
environ = ft_dup_2d_arr(environ, (t_dup_f)ft_strdup);
if (!environ)
return (ft_reti_perror(0, "ft_dup_2d_char_arr(environ) 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(environ); // No return check. Its intended. PATH is optional
c->prompt_base = init_prompt_base();
if (!c->prompt_base)