Commit 4cc3921f authored by abenoit's avatar abenoit
Browse files

builtins return values

parent e7a3cace
builtins: set stat_loc for all returns
========> MALLOC_ERR and WRITE_ERR status return ?
arthur:
......
......@@ -213,6 +213,7 @@ static int ft_export_checks(char **args, t_xe *xe)
if (ft_exported_export(*args, xe) != SUCCESS)
return (MALLOC_ERR);
}
xe->stat_loc = 0;
}
else
{
......@@ -229,9 +230,14 @@ int ft_export(char **args, t_xe *xe)
int ret;
if (ft_arraylen(args) == 1)
{
ret = print_export(xe->env, xe->exported);
if (ret == SUCCESS)
xe->stat_loc = 0;
else
xe->stat_loc = 1;
}
else
ret = ft_export_checks(args + 1, xe);
xe->stat_loc = 0;
return (ret);
}
......@@ -24,6 +24,7 @@ static int unset_one_var(char *var, t_xe *xe)
xe->exported = new_array;
}
}
xe->stat_loc = 0;
return (SUCCESS);
}
......@@ -44,6 +45,5 @@ int ft_unset(char **args, t_xe *xe)
}
args++;
}
xe->stat_loc = 0;
return (SUCCESS);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment