diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-04 14:28:35 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-04 14:28:35 +0200 |
commit | d1ee0c0e55f75432da026f5e0e7cf15cee6918da (patch) | |
tree | f0ba3ebf5f6ba8d2ce093938f36602d64e7b43ff /src/b_unset.c | |
parent | Unset is fine (diff) | |
download | 42-minishell-d1ee0c0e55f75432da026f5e0e7cf15cee6918da.tar.gz 42-minishell-d1ee0c0e55f75432da026f5e0e7cf15cee6918da.tar.bz2 42-minishell-d1ee0c0e55f75432da026f5e0e7cf15cee6918da.tar.xz 42-minishell-d1ee0c0e55f75432da026f5e0e7cf15cee6918da.tar.zst 42-minishell-d1ee0c0e55f75432da026f5e0e7cf15cee6918da.zip |
New libft function strclen, bug fix
Diffstat (limited to '')
-rw-r--r-- | src/b_unset.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/b_unset.c b/src/b_unset.c index 598db92..03fd2a8 100644 --- a/src/b_unset.c +++ b/src/b_unset.c @@ -65,6 +65,8 @@ static void if (i == skip) { i += 1; + if (msh->envp[i] == NULL) + break ; skipped = 1; } if (!(nenvp[i - skipped] = ft_strdup(msh->envp[i]))) @@ -85,7 +87,7 @@ static t_bool i = 0; while (msh->envp[i] != NULL) { - if (ft_strncmp(arg, msh->envp[i], ft_strlen(arg)) == 0) + if (ft_strncmp(arg, msh->envp[i], ft_strclen(msh->envp[i], '=')) == 0) { b_realloc_env(i, msh); return (TRUE); |