summaryrefslogtreecommitdiffstats
path: root/src/s_init.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-09-19 16:59:38 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-09-19 16:59:38 +0200
commit49b6183dc0171ac040bdd2faf6f8efa0448567c5 (patch)
treeeaff08562cedef9bf4267b0d17efce0485d2f51e /src/s_init.c
parentTODO update (diff)
download42-minishell-49b6183dc0171ac040bdd2faf6f8efa0448567c5.tar.gz
42-minishell-49b6183dc0171ac040bdd2faf6f8efa0448567c5.tar.bz2
42-minishell-49b6183dc0171ac040bdd2faf6f8efa0448567c5.tar.xz
42-minishell-49b6183dc0171ac040bdd2faf6f8efa0448567c5.tar.zst
42-minishell-49b6183dc0171ac040bdd2faf6f8efa0448567c5.zip
Cleaner variables handling $0 $1 $2 $3
Diffstat (limited to 'src/s_init.c')
-rw-r--r--src/s_init.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/s_init.c b/src/s_init.c
index 7d2b656..c71ac9a 100644
--- a/src/s_init.c
+++ b/src/s_init.c
@@ -155,19 +155,18 @@ static void
}
}
-t_msh
- *init_msh(char *const argv[], char *const envp[])
+t_msh *init_msh(int32_t argc, char *const argv[], char *const envp[])
{
char cwd[PATH_MAX];
t_msh *msh;
if ((msh = (t_msh*)malloc(sizeof(t_msh))) == NULL)
return (NULL);
- if ((msh->shname = ft_strdup(argv[0])) == NULL)
- return (NULL);
msh->envp = NULL;
if ((msh->envp = dupenv(envp)) == NULL)
return (NULL);
+ msh->argc = argc - 1;
+ msh->argv = (char**)argv;
msh->ret = 0;
init_buptr(msh);
msh->fd = 0;