minishell/src/token/token_list_index.c
2025-03-05 21:18:52 +01:00

26 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* token_list_index.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: qmennen <qmennen@student.codam.nl> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/03/05 20:53:34 by qmennen #+# #+# */
/* Updated: 2025/03/05 21:00:01 by qmennen ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
t_list *token_list_index(t_list *tokens, int index)
{
t_list *current;
int i;
i = 0;
current = tokens;
while ((i++) < index && current)
current = current->next;
return (current);
}