diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-11 16:56:23 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-11 16:56:23 +0200 |
commit | 0ab424df075f09aac376890a9a5a73cb74e053bf (patch) | |
tree | 7dab35480c6005f3bbc7ed864410bf04da9dd0bd /src/s_init.c | |
parent | TODO update (diff) | |
download | 42-minishell-0ab424df075f09aac376890a9a5a73cb74e053bf.tar.gz 42-minishell-0ab424df075f09aac376890a9a5a73cb74e053bf.tar.bz2 42-minishell-0ab424df075f09aac376890a9a5a73cb74e053bf.tar.xz 42-minishell-0ab424df075f09aac376890a9a5a73cb74e053bf.tar.zst 42-minishell-0ab424df075f09aac376890a9a5a73cb74e053bf.zip |
alias in progress
Diffstat (limited to 'src/s_init.c')
-rw-r--r-- | src/s_init.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/s_init.c b/src/s_init.c index cfe2eeb..fb63548 100644 --- a/src/s_init.c +++ b/src/s_init.c @@ -163,11 +163,10 @@ t_msh char cwd[PATH_MAX]; t_msh *msh; - if (!(msh = (t_msh*)malloc(sizeof(t_msh)))) + if ((msh = (t_msh*)malloc(sizeof(t_msh))) == NULL) return (NULL); - if (!(msh->shname = ft_strdup(argv[0]))) + if ((msh->shname = ft_strdup(argv[0])) == NULL) return (NULL); - /* TODO: shname: care about "./", try with symlinks */ msh->envp = NULL; if ((msh->envp = dupenv(envp)) == NULL) return (NULL); @@ -177,6 +176,7 @@ t_msh msh->com = NULL; msh->pipes = NULL; msh->vars = NULL; + msh->alias = NULL; set_cwd(cwd, msh); if ((msh->cwd = ft_strdup(cwd)) == NULL) return (NULL); |