summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-10-22 21:55:05 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-10-22 21:55:05 +0200
commit9d643a31f647e48538e4ea4870b9f20f4a23882b (patch)
treecac63b18f9f37731c79b4b07d6f9fbbb8d21cc33
parentError handled (diff)
download42-minishell-9d643a31f647e48538e4ea4870b9f20f4a23882b.tar.gz
42-minishell-9d643a31f647e48538e4ea4870b9f20f4a23882b.tar.bz2
42-minishell-9d643a31f647e48538e4ea4870b9f20f4a23882b.tar.xz
42-minishell-9d643a31f647e48538e4ea4870b9f20f4a23882b.tar.zst
42-minishell-9d643a31f647e48538e4ea4870b9f20f4a23882b.zip
Fix but more to do
-rw-r--r--Makefile2
-rw-r--r--TODO.org4
-rw-r--r--src/e_redirs.c4
-rw-r--r--src/p_redirs.c3
4 files changed, 8 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 75b0eac..1f559be 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-default: debug
+default: msan
#==============================================================================#
#--------------------------------- SHELL --------------------------------------#
#==============================================================================#
diff --git a/TODO.org b/TODO.org
index 9fbf91d..aa44966 100644
--- a/TODO.org
+++ b/TODO.org
@@ -29,7 +29,9 @@
CLOSED: [2020-10-21 Wed 21:10]
** DONE pipes + conditions "ls | grep kdf && echo yes || echo no"
CLOSED: [2020-10-22 Thu 16:25]
-** TODO 2>&1
+** DONE 2>&1
+ CLOSED: [2020-10-22 Thu 21:47]
+** TODO 'echo qweqwe 1>file' file has 'qweqwe 1' in it
** CANCELED alias ls='clear; ls | grep qwe' <--- aliases not substed in the right place
CLOSED: [2020-10-19 Mon 19:56]
** DONE forked write(2) stuff on cd
diff --git a/src/e_redirs.c b/src/e_redirs.c
index 1d66226..f559ca1 100644
--- a/src/e_redirs.c
+++ b/src/e_redirs.c
@@ -90,8 +90,8 @@ void e_dup_redirs(const t_com *com, t_msh *msh)
e_redir_plus_one(ptr, msh);
else if (ptr->redir == 2)
e_redir_plus_two(ptr, msh);
- /* else if (ptr->redir == 3) */
- /* e_redir_plus_three(ptr, msh); */
+ else if (ptr->redir == 3)
+ dup2(ptr->right_fd, ptr->fd);
ptr = ptr->next;
}
}
diff --git a/src/p_redirs.c b/src/p_redirs.c
index 0ecdee7..86aca27 100644
--- a/src/p_redirs.c
+++ b/src/p_redirs.c
@@ -147,7 +147,8 @@ int8_t p_redirs(char word[], t_com **com, t_msh *msh)
mode = u_meet_dquote(word, ptr, mode);
else if (*ptr == C_SQUOTE)
mode = u_meet_squote(word, ptr, mode);
- else if (mode == Q_NONE && (*ptr == '<' || *ptr == '>') == 1)
+ else if (mode == Q_NONE && (*ptr == '<' || *ptr == '>') == 1
+ && u_is_not_escaped(word, ptr) == TRUE)
{
if (p_get_redir(word, ptr, *com, msh) != 0)
return (1);