Пример #1
0
void fill_struct(t_env *env, char **e)
{
	env->e = ft_arrdup(e);
	env->user = ft_strdup("WTSC");
	env->pwd = (char *)malloc(sizeof(char) * 1024); 	
	getcwd(env->pwd, 1024);
}
Пример #2
0
int			ft_env_setep(t_datas *datas, t_bltenv *env, char **cmd, int i)
{
	int			n;

	env->ep = NULL;
	n = ft_env_setep_count(cmd, i);
	if (n == 0 && ft_strichr(env->opts, 'i') >= 0)
		return (i);
	else if (n != 0 && ft_strichr(env->opts, 'i') >= 0)
		return (ft_env_setep_new(env, cmd, i, n));
	env->ep = ft_arrdup(datas->env);
	if (env->ep == NULL)
		return (-1);
	return (ft_env_setep_dup(env, cmd, i, n));
}