summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-10-22 20:06:42 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-10-22 20:06:42 +0200
commitcb1423079805f4f229782197f510a3138fbe1ee6 (patch)
tree62b1c5178162bbf9bb2d092f711a5ed8bd2f640c
parentOn the way but norm this shit (diff)
download42-minishell-cb1423079805f4f229782197f510a3138fbe1ee6.tar.gz
42-minishell-cb1423079805f4f229782197f510a3138fbe1ee6.tar.bz2
42-minishell-cb1423079805f4f229782197f510a3138fbe1ee6.tar.xz
42-minishell-cb1423079805f4f229782197f510a3138fbe1ee6.tar.zst
42-minishell-cb1423079805f4f229782197f510a3138fbe1ee6.zip
normed
-rw-r--r--src/m_loop.c6
-rw-r--r--src/s_com.c2
-rw-r--r--src/s_lpipes.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/src/m_loop.c b/src/m_loop.c
index a2cf621..732c005 100644
--- a/src/m_loop.c
+++ b/src/m_loop.c
@@ -54,10 +54,8 @@ static void m_parse_and_run_line(char line[], uint8_t previf, t_msh *msh)
continue ;
}
e_line_block(msh);
- if (msh->com != NULL)
- s_com_destroy(&msh->com);
- if (msh->pipes != NULL)
- s_lpipes_clear(&msh->pipes);
+ s_com_destroy(&msh->com);
+ s_lpipes_clear(&msh->pipes);
}
previf = ptr->nextif;
ptr = ptr->next;
diff --git a/src/s_com.c b/src/s_com.c
index 7ed20bc..14dc4ef 100644
--- a/src/s_com.c
+++ b/src/s_com.c
@@ -81,6 +81,8 @@ void s_com_destroy(t_com **com)
{
t_com *ptr;
+ if (*com == NULL)
+ return ;
ptr = *com;
ft_memdel((void*)&ptr->bin);
if (ptr->argv != NULL)
diff --git a/src/s_lpipes.c b/src/s_lpipes.c
index 22ed2a5..0f0529a 100644
--- a/src/s_lpipes.c
+++ b/src/s_lpipes.c
@@ -34,7 +34,7 @@ struct s_lpipes *s_lpipes_last(struct s_lpipes *lpipes)
}
void s_lpipes_add_back(struct s_lpipes **alpipes,
- struct s_lpipes *new)
+ struct s_lpipes *new)
{
struct s_lpipes *tmp;