-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_parsewordtoken.c
More file actions
27 lines (25 loc) · 1.19 KB
/
ft_parsewordtoken.c
File metadata and controls
27 lines (25 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_parsewordtoken.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: makbulut <makbulut@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/10 16:42:27 by makbulut #+# #+# */
/* Updated: 2022/09/05 13:51:32 by makbulut ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
#include "42-Libft/libft.h"
int ft_parsewordtoken(t_command *cmd, t_token **tokens, int i)
{
if (cmd->subshells)
{
ft_syntaxerror(tokens[i]);
return (0);
}
if (!cmd->command)
cmd->command = ft_strdup(tokens[i]->data);
ft_addarr_str(&(cmd->arguments), ft_strdup(tokens[i]->data));
return (1);
}