cmdlist_from_wordlist: make a copy of a wordlist

This commit is contained in:
Khaïs COLIN 2025-03-04 13:31:22 +01:00 committed by Khaïs COLIN
parent a79194de1a
commit 3778d0a7ee
4 changed files with 13 additions and 5 deletions

View file

@ -19,6 +19,7 @@ int main(void)
{
t_wordlist *words = minishell_wordsplit("|");
t_cmdlist *cmd = cmdlist_from_wordlist(words);
wordlist_destroy(words);
assert(cmd == NULL);
return (0);
}

View file

@ -6,7 +6,7 @@
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/24 17:40:48 by khais #+# #+# */
/* Updated: 2025/02/26 17:29:15 by khais ### ########.fr */
/* Updated: 2025/03/04 13:43:39 by khais ### ########.fr */
/* */
/* ************************************************************************** */
@ -23,6 +23,7 @@ static t_cmdlist *parse_command_list(char *input)
ft_dprintf(STDERR_FILENO, "Now checking command list with input [%s]\n", input);
t_wordlist *words = minishell_wordsplit(input);
t_cmdlist *cmd = cmdlist_from_wordlist(words);
wordlist_destroy(words);
return (cmd);
}