fixed redirection issue
This commit is contained in:
@ -6,18 +6,19 @@
|
||||
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/02/07 15:30:37 by tomoron #+# #+# */
|
||||
/* Updated: 2024/03/04 10:10:04 by marde-vr ### ########.fr */
|
||||
/* Updated: 2024/03/04 11:17:02 by marde-vr ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "minishell.h"
|
||||
#include <unistd.h>
|
||||
|
||||
int echo(t_cmd *args)
|
||||
{
|
||||
int put_nl;
|
||||
|
||||
put_nl = 1;
|
||||
while (args && !strcmp(args->token, "-n"))
|
||||
while (args && args->token && !strcmp(args->token, "-n"))
|
||||
{
|
||||
put_nl = 0;
|
||||
args = args->next;
|
||||
@ -30,8 +31,11 @@ int echo(t_cmd *args)
|
||||
{
|
||||
ft_putstr_fd(args->token, STDOUT_FILENO);
|
||||
if (args->next)
|
||||
{
|
||||
ft_printf_fd(2, "yes\n");
|
||||
ft_putchar_fd(' ', STDOUT_FILENO);
|
||||
}
|
||||
}
|
||||
args = args->next;
|
||||
}
|
||||
if (put_nl)
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/02/07 14:12:49 by tomoron #+# #+# */
|
||||
/* Updated: 2024/03/04 10:21:15 by marde-vr ### ########.fr */
|
||||
/* Updated: 2024/03/04 11:03:53 by marde-vr ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -379,8 +379,8 @@ void get_in_type(t_msh *msh, t_cmd *cmds)
|
||||
{
|
||||
ft_printf_fd(2, "minishell: %s: ", cur_cmd->next->token);
|
||||
perror("");
|
||||
g_return_code = 1;
|
||||
// todo: cancel execution of all commands
|
||||
g_return_code = 1;
|
||||
}
|
||||
}
|
||||
cur_cmd = cur_cmd->next;
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/02/02 21:59:20 by tomoron #+# #+# */
|
||||
/* Updated: 2024/03/04 10:21:29 by marde-vr ### ########.fr */
|
||||
/* Updated: 2024/03/04 10:24:54 by marde-vr ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
Reference in New Issue
Block a user