1
0
mirror of https://github.com/KeyZox71/ft_minipowershell.git synced 2025-05-13 16:08:45 +02:00

🔨」 fix: Merge resolved

This commit is contained in:
2024-05-09 16:46:13 +02:00
parent 9b5ebcdbc5
commit ef07733bcc
16 changed files with 1537 additions and 13 deletions

0
src/parsing/get_infile.c Normal file
View File

View File

View File

@ -6,22 +6,23 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/04 15:00:32 by adjoly #+# #+# */
/* Updated: 2024/05/04 15:20:29 by adjoly ### ########.fr */
/* Updated: 2024/05/07 13:56:57 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#include "parsing.h"
#include "libft.h"
t_cmd split_cmd(char *cmd_av)
t_cmd *split_cmd(char *cmd_av)
{
char **split;
char **tmp_split;
t_cmd cmd;
t_cmd *cmd;
split = ft_split(cmd_av, 32);
tmp_split = split;
cmd.cmd = ft_strdup(*tmp_split);
cmd.argv = tmp_split;
cmd = ft_calloc(sizeof(t_cmd), 1);
cmd->cmd = ft_strdup(*tmp_split);
cmd->argv = tmp_split;
return (cmd);
}

31
src/parsing/split_pipe.c Normal file
View File

@ -0,0 +1,31 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* split_pipe.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/07 13:26:40 by adjoly #+# #+# */
/* Updated: 2024/05/08 14:38:33 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
#include "parsing.h"
t_list *split_pipe(char *readline)
{
//char *tmp;
char *av;
//char *cmd_start;
t_list *list;
list = NULL;
if (!list)
{
av = ft_calloc(sizeof(readline), sizeof(char));
ft_strlcpy(av, readline, ft_strlen(readline));
ft_lstadd_back(&list, ft_lstnew((void*)split_cmd(av)));
}
return (list);
}