summaryrefslogtreecommitdiffstats
path: root/src/b_unset.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/b_unset.c4
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);