mirror of
https://github.com/KeyZox71/ft_minipowershell.git
synced 2025-05-11 15:08:47 +02:00
「✨」 feat: Added some security to the parsing
This commit is contained in:
29
src/parsing/check_error/check_argv.c
Normal file
29
src/parsing/check_error/check_argv.c
Normal file
@ -0,0 +1,29 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* check_argv.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/07/03 16:34:19 by adjoly #+# #+# */
|
||||
/* Updated: 2024/07/03 19:07:23 by adjoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "parsing.h"
|
||||
#include "error_msg.h"
|
||||
|
||||
bool check_argv(t_list *token)
|
||||
{
|
||||
t_list *tmp;
|
||||
|
||||
tmp = token;
|
||||
while (tmp)
|
||||
{
|
||||
if (!((t_token *)tmp->content)->argv)
|
||||
return (send_error_parsing(ERROR_NO_CMD));
|
||||
tmp = tmp->next;
|
||||
}
|
||||
return (false);
|
||||
}
|
Reference in New Issue
Block a user