mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-06 07:28:09 +01:00
pipeline: parse basic pipeline commands with two commands
This commit is contained in:
parent
2b8bb859d1
commit
5f1485d1d5
4 changed files with 97 additions and 9 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/13 17:07:01 by khais #+# #+# */
|
||||
/* Updated: 2025/02/14 16:47:04 by khais ### ########.fr */
|
||||
/* Updated: 2025/02/21 14:04:50 by khais ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -91,3 +91,22 @@ t_wordlist *wordlist_push(t_wordlist *wordlist, t_worddesc *worddesc)
|
|||
return (wordlist_destroy(start), NULL);
|
||||
return (start);
|
||||
}
|
||||
|
||||
/*
|
||||
** remove and return the first element in the given wordlist
|
||||
**
|
||||
** If wordlist is empty, return null.
|
||||
*/
|
||||
t_worddesc *wordlist_pop(t_wordlist **wordlist)
|
||||
{
|
||||
t_wordlist *first;
|
||||
t_worddesc *word;
|
||||
|
||||
if ((*wordlist) == NULL)
|
||||
return (NULL);
|
||||
first = *wordlist;
|
||||
(*wordlist) = first->next;
|
||||
word = first->word;
|
||||
free(first);
|
||||
return (word);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue