Пример #1
0
void			ft_fgbg(char **argv, t_config *config, int mode)
{
	size_t	i;

	i = (argv[0][0] == '%' ? 0 : 1);
	if (!argv[i])
		ft_continue(config, NULL, mode);
	else
		while (argv[i])
			ft_continue(config, argv[i++], mode);
}
Пример #2
0
int				ft_fg(t_data *d, char **arg)
{
	int		i;

	i = 1;
	if (ft_tablen(arg) <= 1)
		return (ft_continue(d, d->nb_process - 1));
	else
	{
		while (arg[i])
		{
			if (ft_continue(d, ft_atoi(arg[i])))
			{
				ft_putstr_fd("fg: job not found: ", 2);
				ft_putendl_fd(arg[i], 2);
				return (1);
			}
			i++;
		}
	}
	return (0);
}