signaux fonctionnent sur test
This commit is contained in:
@@ -22,10 +22,14 @@ int builtin_export(int argc, char *argv[], t_all *c)
|
||||
var = ft_split(argv[1], '=');
|
||||
position = getenv_position(c->envp, var[0]);
|
||||
if (position == -1 || !ft_strchr(argv[1], '='))
|
||||
{
|
||||
ft_free_2d_arr(var);
|
||||
return (0);
|
||||
}
|
||||
c->envp[position] = ft_strjoin(var[0], "=");
|
||||
if (var[1]) // parce que ft_strjoin return NULL si var[1] est null, pourquoi ?
|
||||
c->envp[position] = ft_strjoin(c->envp[position], var[1]);
|
||||
c->envp[position] = ft_strjoinfree_s1(c->envp[position], var[1]);
|
||||
ft_free_2d_arr(var);
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -41,7 +45,6 @@ int builtin_export(int argc, char *argv[], t_all *c)
|
||||
** > 'export VARIABLE' n'exporte rien
|
||||
** > 'export VARIABLE=' exporte une variable vide
|
||||
** 4. ordre d'insertion d'une nouvelle variable :
|
||||
**
|
||||
**
|
||||
** > aucune idee
|
||||
*/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user