/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/02 13:49:31 by dkaiser #+# #+# */
-/* Updated: 2024/09/17 19:24:55 by dkaiser ### ########.fr */
+/* Updated: 2024/09/17 19:26:55 by dkaiser ### ########.fr */
/* */
/* ************************************************************************** */
{
t_redirection *result;
t_token *cur;
- int is_redir_only;
cur = *tokens;
result = malloc(sizeof(t_redirection) * 2);
{
if (cur->type == REDIR_TOKEN && cur->next->type == STRING_TOKEN)
{
- is_redir_only = 0;
- if (cur->previous == NULL && cur->next->next == NULL)
- is_redir_only = 1;
cur = collect_redir(tokens, result, cur);
- if (is_redir_only)
- *tokens = NULL;
+ *tokens = (t_token *)(((unsigned long)*tokens) & (~0
+ * (!cur->previous && !cur->next->next)));
}
else if (cur->type == REDIR_TOKEN)
return (free(result), NULL);