variable extern environ fonction avec getenv et export ok

This commit is contained in:
hugogogo
2021-11-25 19:45:41 +01:00
parent 80410e6d81
commit ef3e91be13
10 changed files with 225 additions and 52 deletions

View File

@@ -6,21 +6,24 @@
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/10/04 05:59:26 by lperrey #+# #+# */
/* Updated: 2021/11/08 04:05:41 by lperrey ### ########.fr */
/* Updated: 2021/11/25 16:30:24 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
int main(int argc, char *argv[], char *envp[])
//int main(int argc, char *argv[], char *envp[])
int main(int argc, char *argv[])
{
t_all c;
extern char **environ;
(void)argc;
(void)argv;
if (!init(&c, envp))
//if (!init(&c, envp))
if (!init(&c, environ))
free_exit(&c, EXIT_FAILURE);
putenv("VAR=W1 W2 W3"); // TEMP TEST
//putenv("VAR=W1 W2 W3"); // TEMP TEST
//if (isatty(STDIN_FILENO))
shell_loop(&c);
//else