diff options
| author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-17 18:21:30 +0200 | 
|---|---|---|
| committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-17 18:21:30 +0200 | 
| commit | 65e8b6f93476e2e973f46221f0d80d6c72cdbd7e (patch) | |
| tree | aba01064e5ead3260f5b8e2537cd3fd1a16c9767 /src | |
| parent | Fixed unset not working (diff) | |
| download | 42-minishell-65e8b6f93476e2e973f46221f0d80d6c72cdbd7e.tar.gz 42-minishell-65e8b6f93476e2e973f46221f0d80d6c72cdbd7e.tar.bz2 42-minishell-65e8b6f93476e2e973f46221f0d80d6c72cdbd7e.tar.xz 42-minishell-65e8b6f93476e2e973f46221f0d80d6c72cdbd7e.tar.zst 42-minishell-65e8b6f93476e2e973f46221f0d80d6c72cdbd7e.zip | |
Conditionnal jump fix
Diffstat (limited to '')
| -rw-r--r-- | src/e_line.c | 11 | ||||
| -rw-r--r-- | src/s_init.c | 1 | 
2 files changed, 7 insertions, 5 deletions
| diff --git a/src/e_line.c b/src/e_line.c index e584140..6da7f77 100644 --- a/src/e_line.c +++ b/src/e_line.c @@ -28,7 +28,7 @@ static uint8_t  	uint8_t	i;  	i = 0; -	while (msh->bu_ref[i] && ft_strncmp(bin, msh->bu_ref[i], +	while (msh->bu_ref[i] != NULL && ft_strncmp(bin, msh->bu_ref[i],  		ft_strlen(msh->bu_ref[i]) + 1) != 0)  	{  		i++; @@ -59,14 +59,15 @@ void  		if ((previf == 0) || (previf == 1 && msh->ret == 0) ||  			(previf == 2 && msh->ret != 0))  		{ -			if (ptr->pipes) +			if (ptr->pipes != NULL)  				e_pipes(ptr, msh); -			else if (ptr->com) +			else if (ptr->com != NULL)  			{ -				if ((bu_id = get_builtin_id(ptr->com->bin, msh)) +				if (ptr->com->bin != NULL && +					(bu_id = get_builtin_id(ptr->com->bin, msh))  					< FT_BUILTINS_COUNT)  					e_builtin(ptr->com, bu_id, msh); -				else +				else if (ptr->com->bin != NULL)  					e_extern(ptr->com, msh);  			}  		} diff --git a/src/s_init.c b/src/s_init.c index ab64603..63861e6 100644 --- a/src/s_init.c +++ b/src/s_init.c @@ -143,6 +143,7 @@ t_msh  	msh->curr = NULL;  	msh->vars = NULL;  	msh->cwd = set_cwd(msh); +	msh->env_fork_tmp[0][0] = '\0';  	inc_shlvl(msh);  	return (msh);  } | 
