mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-06 07:28:09 +01:00
feat(redir): fieldsplit redir target, and handle ambiguous redirects
This commit is contained in:
parent
5de82f2940
commit
2dd20b21bc
10 changed files with 137 additions and 12 deletions
|
|
@ -6,13 +6,14 @@
|
|||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/03 15:48:52 by khais #+# #+# */
|
||||
/* Updated: 2025/04/15 11:59:23 by khais ### ########.fr */
|
||||
/* Updated: 2025/04/21 11:56:26 by khais ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "fieldsplit.h"
|
||||
#include "../../buffer/buffer.h"
|
||||
#include "../../parser/matchers/blank.h"
|
||||
#include "redirect_fieldsplit.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
static bool should_delimit(t_worddesc *original, size_t i)
|
||||
|
|
@ -34,7 +35,7 @@ static void fieldsplit_delimit(t_buffer *word, t_buffer *marker,
|
|||
free(marker);
|
||||
}
|
||||
|
||||
static t_wordlist *minishell_fieldsplit(t_worddesc *original,
|
||||
t_wordlist *minishell_fieldsplit(t_worddesc *original,
|
||||
t_wordlist **outlist)
|
||||
{
|
||||
size_t i;
|
||||
|
|
@ -93,5 +94,7 @@ t_simple_cmd *simple_cmd_fieldsplit(t_simple_cmd *cmd)
|
|||
return (NULL);
|
||||
if (wordlist_fieldsplit(&cmd->words) == NULL)
|
||||
return (NULL);
|
||||
if (redirect_fieldsplit(cmd) == NULL)
|
||||
return (NULL);
|
||||
return (cmd);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue